lightweight_tuple

template<typename ...Types>
class tim::lightweight_tuple : public tim::stack_bundle<mpl::available_t<type_list<Types...>>>, public tim::concepts::comp_wrapper

This is a variadic component wrapper which provides the least amount of runtime and compilation overhead.

tparam Types

Specification of the component types to bundle together

Public Functions

template<typename FuncT, typename ...Args>
inline decltype(auto) execute(FuncT &&func, Args&&... args)

when chaining together operations, this function enables executing a function inside the chain

template<typename ...Args>
inline this_type &construct(Args&&... _args)

construct the objects that have constructors with matching arguments

inline this_type &assemble()

provide preliminary info to the objects with matching arguments. This is typically used to notify a component that it has been bundled alongside another component that it can extract data from.

inline this_type &derive()

provide conclusive info to the objects with matching arguments. This is typically used by components to extract data from another component it has been bundled alongside, e.g. the cpu_util component can extract data from tim::component::wall_clock and tim::component::cpu_clock

template<typename ...Args>
inline this_type &mark_begin(Args&&... _args)

mark a beginning position in the execution (typically used by asynchronous structures)

template<typename ...Args>
inline this_type &mark_end(Args&&... _args)

mark a beginning position in the execution (typically used by asynchronous structures)

template<typename ...Args>
inline this_type &store(Args&&... _args)

store a value

template<typename ...Args>
inline this_type &audit(Args&&... _args)

allow the components to inspect the incoming arguments before start or out-going return value before returning (typically using in GOTCHA components)

template<template<typename> class OpT, typename ...Args>
inline this_type &invoke(Args&&... _args)

apply a user-defined operation to all the components

Template Parameters

OpT – Operation struct

template<template<typename> class OpT, typename ...Tp, typename ...Args>
inline this_type &invoke(mpl::piecewise_select<Tp...>, Args&&... _args)

generic member function for invoking user-provided operations on a specific set of component types

Template Parameters

OpT – Operation struct

template<typename T, enable_if_t<is_one_of<T, data_type>::value, int> = 0>
inline T *get()

get member functions taking either a type

template<typename U, typename T = std::remove_pointer_t<decay_t<U>>, enable_if_t<trait::is_available<T>::value && is_one_of<T, data_type>::value, int> = 0>
inline auto get_component()

this is a simple alternative to get<T>() when used from SFINAE in operation namespace which has a struct get also templated. Usage there can cause error with older compilers

template<typename ...T, typename ...Args>
inline auto initialize(Args&&... args)

variadic initialization

template<typename T, typename Func, typename ...Args, enable_if_t<is_one_of<T, data_type>::value, int> = 0>
inline this_type &type_apply(Func &&_func, Args&&... _args)

apply a member function to a type that is in variadic list AND is available

Public Static Functions

static void init_storage()

requests the component initialize their storage