Reference

ACE_TSS_Type_Adapter(3)

Adapter that allows built-in types to be used with ACE_TSS.

NAME

ACE_TSS_Type_Adapter - Adapter that allows built-in types to be used with ACE_TSS.

SYNOPSIS

#include <ace/Synch_T.h>
template<class TYPE>
class ACE_TSS_Type_Adapter
{
  public:
    inline ACE_TSS_Type_Adapter (const TYPE value = 0);
    operator TYPE () { return value_; };
    operator TYPE & () { return value_; };
  private:
    TYPE value_;
};

DESCRIPTION

Wraps a value of a built-in type, providing conversions to and from the type. Example use with ACE_TSS:

ACE_TSSACE_TSS_Type_Adapterint i;
*i = 37;
ACE_OS::fprintf (stderr, "%d\n", *i);

Unfortunately, though, some compilers have trouble with the implicit type conversions. This seems to work better:

ACE_TSSACE_TSS_Type_Adapterint i;
i-operator int & () = 37;
ACE_OS::fprintf (stderr, "%d\n", i-operator int ());

PUBLIC MEMBERS

inline ACE_TSS_Type_Adapter (const TYPE value = 0);

Constructor. Inlined here so that it should _always_ be inlined.

operator TYPE () { return value_; };

TYPE conversion. Inlined here so that it should _always_ be inlined.

operator TYPE & () { return value_; };

TYPE & conversion. Inlined here so that it should _always_ be inlined.

PRIVATE MEMBERS

TYPE value_;

The wrapped value.

AUTHOR

Doug Schmidt

LIBRARY

ace