HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TypeList.h File Reference

A TypeList provides a compile time sequence of heterogeneous types which can be accessed, transformed and executed over in various ways. It incorporates a subset of functionality similar to hboost::mpl::vector however provides most of its content through using declarations rather than additional typed classes. More...

#include "version.h"
#include <tuple>
#include <type_traits>
+ Include dependency graph for TypeList.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >
 A list of types (not necessarily unique) More...
 
struct  openvdb::OPENVDB_VERSION_NAME::TupleList< Ts >
 A trivial wrapper around a std::tuple but with compatible TypeList methods. Importantly can be instatiated from a TypeList and implements a similar ::foreach interface. More...
 
struct  openvdb::OPENVDB_VERSION_NAME::TupleList<>
 Specilization of an empty TupleList. Required due to constructor selection. More...
 

Namespaces

 openvdb
 
 openvdb::OPENVDB_VERSION_NAME
 

Macros

#define OPENVDB_TYPELIST_FORCE_INLINE   OPENVDB_FORCE_INLINE
 

Functions

template<size_t Start, size_t End, typename OpT >
OPENVDB_TYPELIST_FORCE_INLINE auto openvdb::OPENVDB_VERSION_NAME::foreachIndex (OpT op)
 
template<size_t Start, size_t End, typename OpT , typename RetT >
OPENVDB_TYPELIST_FORCE_INLINE RetT openvdb::OPENVDB_VERSION_NAME::evalFirstIndex (OpT op, const RetT def=RetT())
 

Detailed Description

A TypeList provides a compile time sequence of heterogeneous types which can be accessed, transformed and executed over in various ways. It incorporates a subset of functionality similar to hboost::mpl::vector however provides most of its content through using declarations rather than additional typed classes.

Definition in file TypeList.h.

Macro Definition Documentation

#define OPENVDB_TYPELIST_FORCE_INLINE   OPENVDB_FORCE_INLINE

We should usually not be decorating public API functions with attributes such as always_inline. However many compilers are notoriously bad at inlining recursive template loops with default inline settings. The TypeList and TupleList metaprogram constructs heavily use this C++ feature and the performance difference can be substantial, even for very small lists. You can disable this behaviour by setting the define: OPENVDB_TYPELIST_NO_FORCE_INLINE This will disable the force inling on public API methods in this file.

Definition at line 31 of file TypeList.h.