classdesc::Object< This, Base > Struct Template Reference

#include <object.h>

Inheritance diagram for classdesc::Object< This, Base >:
Inheritance graph
Collaboration diagram for classdesc::Object< This, Base >:
Collaboration graph

Public Member Functions

virtual Base::TypeID type () const
 
virtual objectclone () const
 
This * cloneT () const
 same as clone(), but returning fully typed pointer
 
virtual void pack (pack_t &b) const
 
virtual void unpack (pack_t &b)
 

Detailed Description

template<class This, class Base = object>
struct classdesc::Object< This, Base >

template for handling polymorphic heirarchy, saves having to explicitly declare all the virtual functions. Uses the curiously recurring template pattern. Declare a new type foo, derived from bar having type identifier t as

class foo: public
Object<foo,t,bar>
{...

NB. This class is unsuitable as a base of an abstract class. Use object for that purpose instead.

Member Function Documentation

◆ type()

template<class This, class Base = object>
virtual Base::TypeID classdesc::Object< This, Base >::type ( ) const
inlinevirtual

warning, this method should not be called before main() in any other module than the one declaring classdesc::factory


The documentation for this struct was generated from the following file: