Classdesc 3.44
PolyPack< T > Struct Template Reference

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

#include <polyPackBase.h>

Inheritance diagram for PolyPack< T >:
Inheritance graph
Collaboration diagram for 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.

Member Function Documentation

◆ pack()

template<class T>
void pack ( pack_t & x,
const string & d ) const
inlinevirtual

Implements PolyPackBase.

◆ unpack()

template<class T>
void unpack ( unpack_t & x,
const string & d )
inlinevirtual

Implements PolyPackBase.


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