tool::types< Type > Struct Template Reference

Virual types for static hierarchies . More...

#include <wipal/tool/static_base.hh>

Inherited by tool::types< pcapxx::list_of_traces< Desc, Bottom > >.


Detailed Description

template<class Type>
struct tool::types< Type >

Virual types for static hierarchies .

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 WP_TYPE() preprocessor macro.

E.g.

 template <class Bottom>
 struct iterable : public WP_INHERIT(public static_base, iterable<Bottom>)
 {
   typedef WP_GET_EXACT(Bottom, iterable<Bottom>)       exact_type;

   typedef WP_TYPE(iterator, exact_type)                iterator;

   // ...
 };

See also:
static_base

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

Generated on Thu Jul 31 16:39:04 2008 for wipal by  doxygen 1.5.6