#include <wipal/tool/static_base.hh>
Inherited by tool::types< pcapxx::list_of_traces< Desc, Bottom > >.
In static hierarchies it is often desirable to define virtual types. That is, types that will be defined in subclasses but must exist in the parent class. (e.g. iterable provides an iterable::iterator
type, but this type is actually defined in iterable's subclasses.) For technical reasons, one must define virtual types in external classes. This is types's role.
Declare foo
's virtual types in types<foo>
:
template <> struct types<foo> { typedef bar type1; typedef baz type2; };
Inside a class, access a virtual type with the tt_type()
preprocessor macro.
E.g.
template <class Bottom> struct iterable : public tt_inherit(public static_base, iterable<Bottom>) { typedef tt_get_exact(Bottom, iterable<Bottom>) exact_type; typedef tt_type(iterator, exact_type) iterator; // ... };