T | Class that defines the type identifier. | |
ST | Optional identification of the subtype if T needs more than one type. |
// ***************************************************** // client header file #include <osbtype.h> // get this header class Demo; // forward declaration // check the Demo type identfier bool checkType(TypeId<Demo> t); // ***************************************************** // class header file class Demo { public: enum { t1 = 1, t2, t3 }; typedef TypeId<Demo> Type; }; // ***************************************************** // client implementation #include <demo.h> // class Demo bool checkType(Demo::Type t) { return t.valid(); } // ***************************************************** // class implementation file template<> const long Demo::Type::minType_ = Demo::t1; template<> const long Demo::Type::maxType_ = Demo::t3;
class Demo { public: typedef TypeId<Demo> Type; enum DemoType { t1 = 1, t2, t3 }; public: Type type() const { return type_; } DemoType demoType() const { return type().toLong(); } private: Type type_; };
Definition at line 120 of file osbtype.h.
OSB_LIB::TypeId< T, ST >::TypeId | ( | long | type = notSet_ |
) | [inline, explicit] |
static long OSB_LIB::TypeId< T, ST >::maxType | ( | ) | [inline, static] |
static long OSB_LIB::TypeId< T, ST >::minType | ( | ) | [inline, static] |
static TypeId OSB_LIB::TypeId< T, ST >::mkUnknown | ( | ) | [inline, static] |
bool OSB_LIB::TypeId< T, ST >::notSet | ( | ) | const [inline] |
Type identifier not set?
Definition at line 155 of file osbtype.h.
Referenced by OSB_DB::OtlType::OtlType(), and OSB_LIB::TypeId< OSB_LIB::Device >::TypeId().
bool OSB_LIB::TypeId< T, ST >::operator!= | ( | const TypeId< T, ST > & | rhs | ) | const [inline] |
bool OSB_LIB::TypeId< T, ST >::operator< | ( | const TypeId< T, ST > & | rhs | ) | const [inline] |
bool OSB_LIB::TypeId< T, ST >::operator== | ( | const TypeId< T, ST > & | rhs | ) | const [inline] |
Same type identifier?
Definition at line 165 of file osbtype.h.
Referenced by OSB_LIB::TypeId< OSB_LIB::Device >::operator!=().
long OSB_LIB::TypeId< T, ST >::toLong | ( | ) | const [inline] |
Convert to long.
This is member should be used only:
Definition at line 189 of file osbtype.h.
Referenced by OSB_LIB::operator<<().
bool OSB_LIB::TypeId< T, ST >::unKnown | ( | ) | const [inline] |
bool OSB_LIB::TypeId< T, ST >::valid | ( | ) | const [inline] |
const long OSB_LIB::TypeId< T, ST >::maxType_ [static, private] |
Maximum type identifer.
Contrary to notSet_ and unknown_ this member is NOT defined in this header.
The class that defines the type must do this in its implementation file, see class description for an example.
Definition at line 218 of file osbtype.h.
Referenced by OSB_LIB::TypeId< OSB_LIB::Device >::maxType(), and OSB_LIB::TypeId< OSB_LIB::Device >::TypeId().
const long OSB_LIB::TypeId< T, ST >::minType_ [static, private] |
Minimum type identifer.
Contrary to notSet_ and unknown_ this member is NOT defined in this header.
The class that defines the type must do this in its implementation file, see class description for an example.
Definition at line 209 of file osbtype.h.
Referenced by OSB_LIB::TypeId< OSB_LIB::Device >::minType(), and OSB_LIB::TypeId< OSB_LIB::Device >::TypeId().
const long OSB_LIB::TypeId< T, ST >::notSet_ = 0 [static, private] |
Value if type is not set.
Definition at line 198 of file osbtype.h.
Referenced by OSB_LIB::TypeId< OSB_LIB::Device >::notSet(), and OSB_LIB::TypeId< OSB_LIB::Device >::valid().
long OSB_LIB::TypeId< T, ST >::type_ [private] |
The type identifier.
Definition at line 195 of file osbtype.h.
Referenced by OSB_LIB::TypeId< OSB_LIB::Device >::notSet(), OSB_LIB::TypeId< OSB_LIB::Device >::operator<(), OSB_LIB::TypeId< OSB_LIB::Device >::operator==(), OSB_LIB::TypeId< OSB_LIB::Device >::toLong(), OSB_LIB::TypeId< OSB_LIB::Device >::TypeId(), OSB_LIB::TypeId< OSB_LIB::Device >::unKnown(), and OSB_LIB::TypeId< OSB_LIB::Device >::valid().
const long OSB_LIB::TypeId< T, ST >::unknown_ = -1 [static, private] |
Value if type is unknown.
Definition at line 200 of file osbtype.h.
Referenced by OSB_LIB::TypeId< OSB_LIB::Device >::mkUnknown(), OSB_LIB::TypeId< OSB_LIB::Device >::TypeId(), OSB_LIB::TypeId< OSB_LIB::Device >::unKnown(), and OSB_LIB::TypeId< OSB_LIB::Device >::valid().