classdesc::PolyPack< T > Struct Template Reference

utility class for defining pack descriptors for polymorphic types More...

#include <polyPackBase.h>

Inheritance diagram for classdesc::PolyPack< T >:
Inheritance graph
Collaboration diagram for classdesc::PolyPack< T >:
Collaboration graph

Public Member Functions

void pack (pack_t &x, const string &d) const
 
void unpack (unpack_t &x, const string &d)
 

Detailed Description

template<class T>
struct classdesc::PolyPack< T >

utility class for defining pack descriptors for polymorphic types

Use as class MyBase: public PolyBase<int> { static MyBase* create(int); // factory method };

template <int t>=""> class MyClass: public Poly<MyClass, MyBase>, public PolyPack<MyClass, int> { public: int type() const {return t;} };

Note use of "curiously recurring template pattern", and multiple inheritance to implement mixins.


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