Author: James CE Johnson

ACE Tutorial 018
The FIFO Nature of ACE_Token

Here we create simple derivatives of our Test templated class. Each is parameterized with our mutex of choice and "named". Using the Test template we're able to reuse all of the code with practially no retyping and certainly much less chance of error!

Token_i.h

    // page05.html,v 1.5 1999/04/03 21:56:33 jcej Exp

    #ifndef TOKEN_I_H
    #define TOKEN_I_H

    #include "Test_T.h"

    // Go get ace/Token.h so that we know what an ACE_Token is.
    #include "ace/Token.h"

    /* Create a very simple derivative of our Test template.  All we have
       to do is provide our mutex choice and a name.
     */
    class Token : public Test_T<ACE_Token>
    {
    public:
      Token (void): Test_T<ACE_Token> ("Token") {}
    };

    #endif /* TOKEN_I_H */

Mutex_i.h

    // page05.html,v 1.5 1999/04/03 21:56:33 jcej Exp

    #ifndef MUTEX_I_H
    #define MUTEX_I_H

    #include "Test_T.h"

    /* Create a very simple derivative of our Test template.  All we have
       to do is provide our mutex choice and a name.
     */
    class Mutex : public Test_T<ACE_Mutex>
    {
    public:
      Mutex (void) : Test_T<ACE_Mutex> ("Mutex") {}
    };

    #endif /* MUTEX_I_H */

[Tutorial Index] [Continue This Tutorial]