![]() |
Typelists are the core fundamental base upon which all complex metaprogramming rests. While their use isn't mandatory, a whole pile of things become way, way easier if you have them. Much of the TnFOX generic tools library uses typelists to implement itself.
There's not much to say except that like with all other code in the generic tools library, value is always the value where applicable. TL::item is an item in the list though TL::item is also the list itself (due to the recursive nature of typelist definitions). The method naming follows the same style at the QTL, including semantics.
Example:
typedef TL::create<char, short, int>::value Ints; template<typename type> Handler { static const bool typeIsInt=TL::find<Ints, type>::value>=0 }; };
Namespaces | |
namespace | TL |
Classes | |
struct | FX::Generic::TL::item< A, B > |
A single item within the list. More... | |
struct | FX::Generic::TL::create< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16 > |
Creates a typelist with up to 16 types. More... | |
struct | FX::Generic::TL::length< typelist > |
Determines the length of a typelist. More... | |
struct | FX::Generic::TL::at< typelist, idx > |
Returns the type at index idx, returning NullType if out of bounds. More... | |
struct | FX::Generic::TL::atC< typelist, idx > |
Returns the type at index idx, throwing an error if out of bounds. More... | |
struct | FX::Generic::TL::find< typelist, type > |
Returns the index of the specified type in the list or -1 if not found. More... | |
struct | FX::Generic::TL::findC< typelist, type > |
Returns the index of the specified type in the list, throwing an error if not found. More... | |
struct | FX::Generic::TL::findParent< typelist, type > |
Returns the index of the first parent class of the specified type in the list or -1 if not found. More... | |
struct | FX::Generic::TL::findParentC< typelist, type > |
Returns the index of the specified type in the list, throwing an error if not found. More... | |
struct | FX::Generic::TL::append< typelist, type > |
Appends a type or typelist. More... | |
struct | FX::Generic::TL::remove< typelist, type > |
Removes a type from a list. More... | |
struct | FX::Generic::TL::numberRange< no, instance > |
Creates a typelist composed of types instantiated by a number running from 0 to no. More... | |
struct | FX::Generic::TL::apply< typelist, instance > |
Applies each type in a typelist to the template instance, returning a typelist. More... | |
struct | FX::Generic::TL::filter< typelist, filt > |
Reduces from a typelist to another based on a binary predicate. More... | |
struct | FX::Generic::TL::replicate< no, type > |
Generates a typelist of no copies of a type. More... | |
struct | FX::Generic::TL::instanceHolderH< type > |
Default holder for instanceH. More... | |
struct | FX::Generic::TL::instantiateH< typelist, instance, idx > |
Horizontally instantiates a container containing a holder for each item in a typelist. More... | |
struct | FX::Generic::TL::dynamicAt< typelist, instance > |
Assembles code to call some templated code with the type from a typelist. More... | |
Functions | |
template<int i, class container> | |
Private::accessInstantiateH< i, container >::IdxType & | FX::Generic::TL::instance (container &c) |
Private::accessInstantiateH<i, container>::IdxType& FX::Generic::TL::instance | ( | container & | c | ) | [inline] |
Helper function for disambiguating instanced members of an instantiated typelist. Simply specify the original index of the type within the list to access. Remember it returns a reference to the instance template parameter to instantiateH.
Referenced by FX::TnFXApp::instance(), FX::FXEventLoop_Static< type >::operator type *(), FX::FXEventLoop_Static< type >::operator->(), FX::FXEventLoop_Static< type >::operator=(), FX::Generic::DoUndo< FX::QThread, void(QThread::*)(), void(QThread::*)()>::redo(), and FX::Generic::DoUndo< FX::QThread, void(QThread::*)(), void(QThread::*)()>::undo().