|
Classdesc 3.44
|
utility class for defining pack descriptors for polymorphic types More...
#include <polyPackBase.h>


Public Member Functions | |
| void | pack (pack_t &x, const string &d) const |
| void | unpack (unpack_t &x, const string &d) |
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.
Implements PolyPackBase.
Implements PolyPackBase.