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

this_type &push()

generic push into storage

this_type &pop()

generic pop out of storage

template<typename ...Tp>
this_type &push(mpl::piecewise_select<Tp...>)

selective push

template<typename ...Tp>
this_type &push(mpl::piecewise_ignore<Tp...>)

selective push

template<typename ...Tp>
this_type &pop(mpl::piecewise_select<Tp...>)

selective pop

template<typename ...Tp>
this_type &pop(mpl::piecewise_ignore<Tp...>)

selective pop

template<typename ...Args>
this_type &start(Args&&...)

start all applicable components

template<typename ...Tp, typename ...Args>
this_type &start(mpl::piecewise_select<Tp...>, Args&&...)

selective start

template<typename ...Tp, typename ...Args>
this_type &start(mpl::piecewise_ignore<Tp...>, Args&&...)

selective start

template<typename ...Args>
this_type &stop(Args&&...)

stop all applicable components

template<typename ...Tp, typename ...Args>
this_type &stop(mpl::piecewise_select<Tp...>, Args&&...)

selective stop

template<typename ...Tp, typename ...Args>
this_type &stop(mpl::piecewise_ignore<Tp...>, Args&&...)

selection stop

template<typename ...Args>
this_type &measure(Args&&...)

generic

template<typename ...Args>
this_type &sample(Args&&...)

generic

template<typename ...Args>
this_type &record(Args&&...)

generic

template<typename ...Args>
this_type &reset(Args&&...)

generic

template<typename ...Args>
auto get(Args&&...) const

generic

template<typename ...Args>
auto get_labeled(Args&&...) const

generic

data_type &data()

get tuple

const data_type &data() const

get tuple

this_type &set_scope(scope::config)

set scope configuration

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<typename ...Args>
inline this_type &add_secondary(Args&&... _args)

perform an add_secondary operation. This operation allows components to add additional entries to storage which are their direct descendant

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

perform an add_secondary operation. This operation allows components to add additional entries to storage which are their direct descendant

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<template<typename> class OpT, typename ...Tp, typename ...Args>
inline this_type &invoke(mpl::piecewise_ignore<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 T, typename FuncT>
decltype(auto) get(FuncT &&_func)

get member functions finding component and applying lambda

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