HDK
|
A list of types (not necessarily unique) More...
#include <TypeList.h>
Public Types | |
using | Self = TypeList |
The type of this list. More... | |
using | AsTupleList = TupleList< Ts...> |
template<size_t N> | |
using | Get = typename typelist_internal::TSGetElementImpl< Self, N >::type |
Access a particular element of this type list. If the index is out of range, typelist_internal::NullType is returned. More... | |
using | Front = Get< 0 > |
using | Back = Get< Size-1 > |
template<typename ListT = TypeList<>> | |
using | Unique = typename typelist_internal::TSRecurseAppendUniqueImpl< ListT, Ts...>::type |
Remove any duplicate types from this TypeList by rotating the next valid type left (maintains the order of other types). Optionally combine the result with another TypeList. More... | |
template<typename... TypesToAppend> | |
using | Append = typename typelist_internal::TSAppendImpl< Self, TypesToAppend...>::type |
Append types, or the members of another TypeList, to this list. More... | |
template<typename... TypesToRemove> | |
using | Remove = typename typelist_internal::TSRemoveImpl< Self, TypesToRemove...>::type |
Remove all occurrences of one or more types, or the members of another TypeList, from this list. More... | |
using | PopFront = typename typelist_internal::TSRemoveFirstImpl< Self >::type |
Remove the first element of this type list. Has no effect if the type list is already empty. More... | |
using | PopBack = typename typelist_internal::TSRemoveLastImpl< Self >::type |
Remove the last element of this type list. Has no effect if the type list is already empty. More... | |
template<size_t First, size_t Last> | |
using | RemoveByIndex = typename typelist_internal::TSRemoveIndicesImpl< Self, First, Last >::type |
Return a new list with types removed by their location within the list. If First is equal to Last, a single element is removed (if it exists). If First is greater than Last, the list remains unmodified. More... | |
template<template< typename > class OpT> | |
using | Transform = typename typelist_internal::TSTranformImpl< OpT, Ts...>::type |
Transform each type of this TypeList, rebuiling a new list of converted types. This method instantiates a user provided Opt<T> to replace each type in the current list. More... | |
Static Public Member Functions | |
template<template< typename > class OpT> | |
static OPENVDB_TYPELIST_FORCE_INLINE void | foreach () |
Invoke a templated class operator on each type in this list. Use this method if you only need access to the type for static methods. More... | |
template<typename OpT > | |
static OPENVDB_TYPELIST_FORCE_INLINE void | foreach (OpT op) |
Invoke a templated, unary functor on a value of each type in this list. More... | |
template<typename OpT > | |
static OPENVDB_TYPELIST_FORCE_INLINE void | foreachIndex (OpT op) |
template<typename OpT , typename RetT > | |
static OPENVDB_TYPELIST_FORCE_INLINE RetT | foreachIndex (OpT op, RetT def) |
template<typename OpT , typename BaseT > | |
static OPENVDB_TYPELIST_FORCE_INLINE bool | apply (OpT op, BaseT &obj) |
Invoke a templated, unary functor on a provide obj of type BaseT only if said object is an applicable (derived) type also contained in the current TypeList . More... | |
Static Public Attributes | |
static constexpr size_t | Size = sizeof...(Ts) |
The number of types in the type list. More... | |
template<typename T > | |
static constexpr bool | Contains = typelist_internal::TSHasTypeImpl<Self, T>::Value |
True if this list contains the given type, false otherwise. More... | |
template<typename T > | |
static constexpr int64_t | Index = typelist_internal::TSHasTypeImpl<Self, T>::Index |
Returns the index of the first found element of the given type, -1 if no matching element exists. More... | |
A list of types (not necessarily unique)
Example:
Definition at line 577 of file TypeList.h.
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::Append = typename typelist_internal::TSAppendImpl<Self, TypesToAppend...>::type |
Append types, or the members of another TypeList, to this list.
Example:
Definition at line 656 of file TypeList.h.
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::AsTupleList = TupleList<Ts...> |
Definition at line 582 of file TypeList.h.
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::Back = Get<Size-1> |
Definition at line 592 of file TypeList.h.
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::Front = Get<0> |
Definition at line 591 of file TypeList.h.
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::Get = typename typelist_internal::TSGetElementImpl<Self, N>::type |
Access a particular element of this type list. If the index is out of range, typelist_internal::NullType is returned.
Definition at line 590 of file TypeList.h.
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::PopBack = typename typelist_internal::TSRemoveLastImpl<Self>::type |
Remove the last element of this type list. Has no effect if the type list is already empty.
Example:
Definition at line 699 of file TypeList.h.
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::PopFront = typename typelist_internal::TSRemoveFirstImpl<Self>::type |
Remove the first element of this type list. Has no effect if the type list is already empty.
Example:
Definition at line 684 of file TypeList.h.
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::Remove = typename typelist_internal::TSRemoveImpl<Self, TypesToRemove...>::type |
Remove all occurrences of one or more types, or the members of another TypeList, from this list.
Example:
Definition at line 669 of file TypeList.h.
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::RemoveByIndex = typename typelist_internal::TSRemoveIndicesImpl<Self, First, Last>::type |
Return a new list with types removed by their location within the list. If First is equal to Last, a single element is removed (if it exists). If First is greater than Last, the list remains unmodified.
Example:
Definition at line 716 of file TypeList.h.
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::Self = TypeList |
The type of this list.
Definition at line 580 of file TypeList.h.
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::Transform = typename typelist_internal::TSTranformImpl<OpT, Ts...>::type |
Transform each type of this TypeList, rebuiling a new list of converted types. This method instantiates a user provided Opt<T> to replace each type in the current list.
Example:
Definition at line 736 of file TypeList.h.
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::Unique = typename typelist_internal::TSRecurseAppendUniqueImpl<ListT, Ts...>::type |
Remove any duplicate types from this TypeList by rotating the next valid type left (maintains the order of other types). Optionally combine the result with another TypeList.
Example:
Definition at line 638 of file TypeList.h.
|
inlinestatic |
Invoke a templated, unary functor on a provide obj
of type BaseT
only if said object is an applicable (derived) type also contained in the current TypeList
.
This method loops over every type in the type list and calls an interface method on obj
to check to see if the obj
is interpretable as the given type. If it is, the method static casts obj
to the type, invokes the provided functor with the casted type and returns, stopping further list iteration. obj
is expected to supply an interface to validate the type which satisfies the prototype:
A full example (using dynamic_cast - see Grid/Tree implementations for string based comparisons:
std::ref
pass by reference. Definition at line 831 of file TypeList.h.
|
inlinestatic |
Invoke a templated class operator on each type in this list. Use this method if you only need access to the type for static methods.
Example:
Definition at line 756 of file TypeList.h.
|
inlinestatic |
Invoke a templated, unary functor on a value of each type in this list.
Example:
std::ref
to use the same object for each type. Definition at line 781 of file TypeList.h.
|
inlinestatic |
Definition at line 786 of file TypeList.h.
|
inlinestatic |
Definition at line 791 of file TypeList.h.
|
static |
True if this list contains the given type, false otherwise.
Example:
Definition at line 607 of file TypeList.h.
|
static |
Returns the index of the first found element of the given type, -1 if no matching element exists.
Example:
Definition at line 623 of file TypeList.h.
|
static |
The number of types in the type list.
Definition at line 585 of file TypeList.h.