![]() |
Static Public Member Functions | |
static void | constructClass (const CustomTypeFactory< typeCode > &factory) |
static void | deconstructClass (void) |
![]() | |
static void | setListener (const BaseListener *baseListener) |
static int | getDebugOutputLevel (void) |
static bool | setDebugOutputLevel (int debugLevel) |
static const LogFormatOptions & | getLogFormatOptions (void) |
static void | setLogFormatOptions (const LogFormatOptions &options) |
Static Public Attributes | |
static const nByte | TypeCode |
Additional Inherited Members | |
![]() | |
virtual void | cleanup (void)=0 |
virtual bool | compare (const CustomTypeBase &other) const =0 |
virtual void | duplicate (CustomTypeBase *pRetVal) const =0 |
virtual void | deserialize (const nByte *pData, short length)=0 |
virtual short | serialize (nByte *pRetVal) const =0 |
![]() | |
virtual | ~Base (void) |
![]() | |
virtual | ~ToString (void) |
virtual JString | typeToString (void) const |
virtual JString & | toString (JString &retStr, bool withTypes=false) const =0 |
JString | toString (bool withTypes=false) const |
The CustomType class provides you with an interface, to add support for additional data-types.
We only support a certain subset of Datatypes out of the box. If you need support for further datatypes, then you can easily add this support yourself by subclassing this class template and providing suitable implementations for the pure virtual functions, which are inherited from CustomTypeBase, in your subclass. You should only subclass every typecode once. typeCode 0 should be considered as reserved. So your first custom type would inherit from CustomType<1>, the second one from CustomType<2> and so on. Subclassing the same typecode multiple times will lead into undefined behavior as the typecode will determine the class as instance of which serialized data should be interpreted.
|
static |
This static function initializes the class and has to be called once before any instance of a concrete subclass gets created. It registers the typecode and sets the factory-class to a copy of the passed parameter.
factory | an instance of the factory class, which will be used to create instances of this class |
|
static |
This static function cleans up the class and has to be called once after the last instance of a concrete subclass has been deallocated. It will then deallocate the shared instance of the according CustomTypeFactory subclass.
|
static |
Check this public constant to find out the typecode of a custom type at runtime. This should normally not be of any interest.