Lumiera  0.pre.03
»edit your freedom«
typelist-manip.hpp File Reference

Go to the source code of this file.

Description

Metaprogramming: Helpers for manipulating lists-of-types.

Sometimes, we use metaprogramming to generate a variation of concrete implementations by combining some basic building blocks. Typically, there is a number of similar, but not suitably related types involved. We want to process those types using a common scheme, without being forced to squeeze all those types into a artificial inheritance relationship. Now, generating some kind of common factory or adapter, while mixing in pieces of code tailored specifically to the individual types, allows still to build a common processing in such situations.

The facilities in this header provide the basics of simple functional list processing (mostly with tail recursion). Usually, there is one template parameter TYPES, which accepts a Type-list. The result of the processing step is then accessible as an embedded typedef named List . Here, all of the 'processing' to calculate this result is performed by the compiler, as a side-effect of figuring out the resulting concrete type. At run time, in the generated code, typically the resulting classes are empty, maybe just exposing a specifically built-up function.

See also
generator.hpp
typelist-manip-test.cpp
TimeControl_test usage example
typelist.hpp

Definition in file typelist-manip.hpp.

#include "lib/meta/typelist.hpp"
#include <sys/types.h>

Classes

struct  Append< TY1, TY2 >
 append lists-of-types More...
 
struct  Append< Node< TY, TYPES >, NullType >
 
struct  Append< Node< TY, TYPES >, TAIL >
 
struct  Append< NullType, Node< TY, TYPES > >
 
struct  Append< NullType, NullType >
 
struct  Append< NullType, TY2 >
 
struct  Append< TY1, NullType >
 
struct  Apply< TY, _TRANS_ >
 apply a transformation (template) to each type in the list More...
 
struct  Apply< Node< TY, TYPES >, _TRANS_ >
 
struct  Combine< X, _ENUM_ >
 build all possible combinations, based on a enumeration of the basic cases. More...
 
struct  Combine< Node< TY, TYPES >, _ENUM_ >
 
struct  Combine< NullType, _ENUM_ >
 
struct  CombineFlags< FLAGS >
 generate all possible on-off combinations of the given flags More...
 
struct  CondNode< bool, T, TAIL >
 conditional node: skip an element based on evaluating a predicate More...
 
struct  CondNode< true, T, TAIL >
 
struct  Dissect< TYPES >
 Allows to access various parts of a given typelist: Start and End, Prefix and Tail... More...
 
struct  Dissect< Node< T, TYPES > >
 
struct  Dissect< NullType >
 
struct  Distribute< TY1, TY2 >
 build a list-of lists, where each element of the first arg list gets in turn prepended to all elements of the second arg list. More...
 
struct  Distribute< Node< TY, TYPES >, TAIL >
 
struct  Distribute< NullType, TY >
 
struct  Filter< TYPES, _P_ >
 filter away those types which don't fulfil a predicate metafunction More...
 
struct  Filter< Node< TY, TYPES >, _P_ >
 
struct  Filter< NullType, _P_ >
 
struct  FlagOnOff< F >
 enumeration generator for the Combine metafunction, yielding an "on" and "off" case More...
 
struct  Pick< TYPES, i >
 pick the n-th element from a typelist More...
 
struct  Pick< Node< TY, TYPES >, 0 >
 
struct  Pick< Node< TY, TYPES >, i >
 
struct  PrefixAll< T, TY >
 prefix each of the elements, yielding a list-of lists-of-types More...
 
struct  PrefixAll< T, Node< TY, TYPES > >
 
struct  PrefixAll< T, NodeNull >
 
struct  PrefixAll< T, NullType >
 
struct  Splice< BASE, OVERLAY, i >
 splice a typelist like an overlay into an base typelist, starting at given index. More...
 
struct  Splice< Node< B, BS >, Node< O, OS >, 0 >
 
struct  Splice< Node< B, BS >, NullType, 0 >
 
struct  Splice< Node< B, BS >, OVERLAY, i >
 
struct  Splice< NullType, XX, i >
 
struct  SplitLast< TYPES >
 access the last list element More...
 
struct  SplitLast< Node< TY, NullType > >
 
struct  SplitLast< Node< TY, TYPES > >
 
struct  SplitLast< NullType >
 

Namespaces

 lib
 Implementation namespace for support and library code.