Classdesc 3.44
Object< This, Base > Struct Template Reference

#include <object.h>

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

Public Member Functions

virtual Base::TypeID type () const
virtual classdesc::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)
Public Member Functions inherited from object
classdesc::objectcloneT () const

Additional Inherited Members

Public Types inherited from object
typedef int TypeID
Static Public Member Functions inherited from object
static classdesc::objectcreate (TypeID)

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>
{...
Definition object.h:77
Definition input.h:3

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

Member Function Documentation

◆ clone()

template<class This, class Base = object>
virtual classdesc::object * clone ( ) const
inlinevirtual

Implements object.

◆ pack()

template<class This, class Base = object>
virtual void pack ( pack_t & b) const
inlinevirtual

Implements object.

◆ type()

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

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

Implements object.

◆ unpack()

template<class This, class Base = object>
virtual void unpack ( pack_t & b)
inlinevirtual

Implements object.


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