25#ifndef TIMEMORY_VARIADIC_LIGHTWEIGHT_TUPLE_CPP_
26#define TIMEMORY_VARIADIC_LIGHTWEIGHT_TUPLE_CPP_ 1
43template <
typename... Types>
44template <
typename... T>
56template <
typename... Types>
57template <
typename... T>
69template <
typename... Types>
70template <
typename... T>
81template <
typename... Types>
92template <
typename... Types>
102template <
typename... Types>
111template <
typename... Types>
123template <
typename... Types>
129 tmp.m_scope = _scope;
136template <
typename... Types>
149 return get_this_type();
155template <
typename... Types>
156template <
typename... Tp>
162 invoke_piecewise<operation::reset>(pw_type{});
164 invoke_piecewise<operation::push_node>(pw_type{}, m_scope, m_hash);
165 return get_this_type();
171template <
typename... Types>
172template <
typename... Tp>
178 invoke_piecewise<operation::reset>(pw_type{});
180 invoke_piecewise<operation::push_node>(pw_type{}, m_scope, m_hash);
181 return get_this_type();
187template <
typename... Types>
198 return get_this_type();
204template <
typename... Types>
205template <
typename... Tp>
211 invoke_piecewise<operation::pop_node>(pw_type{});
212 return get_this_type();
218template <
typename... Types>
219template <
typename... Tp>
225 invoke_piecewise<operation::pop_node>(pw_type{});
226 return get_this_type();
232template <
typename... Types>
233template <
typename... Args>
238 return get_this_type();
244template <
typename... Types>
245template <
typename... Args>
249 invoke::invoke<operation::sample, TIMEMORY_API>(m_data, std::forward<Args>(args)...);
250 return get_this_type();
256template <
typename... Types>
257template <
typename... Args>
263 return get_this_type();
269template <
typename... Types>
270template <
typename... Tp,
typename... Args>
276 return get_this_type();
282template <
typename... Types>
283template <
typename... Tp,
typename... Args>
290 auto&& _data = mpl::get_reference_tuple<selected_t>(m_data);
292 return get_this_type();
297template <
typename... Types>
298template <
typename... Args>
305 return get_this_type();
311template <
typename... Types>
312template <
typename... Tp,
typename... Args>
318 return get_this_type();
324template <
typename... Types>
325template <
typename... Tp,
typename... Args>
332 auto&& _data = mpl::get_reference_tuple<selected_t>(m_data);
334 return get_this_type();
340template <
typename... Types>
341template <
typename... Args>
347 return get_this_type();
353template <
typename... Types>
354template <
typename... Args>
360 return get_this_type();
366template <
typename... Types>
367template <
typename... Args>
371 return invoke::get(m_data, std::forward<Args>(args)...);
377template <
typename... Types>
378template <
typename... Args>
388template <
typename... Types>
392 invoke::invoke_impl::invoke_data<operation::minus, TIMEMORY_API>(m_data, rhs.
m_data);
393 m_laps -= rhs.m_laps;
394 return get_this_type();
399template <
typename... Types>
403 invoke::invoke_impl::invoke_data<operation::minus, TIMEMORY_API>(m_data, rhs.
m_data);
404 m_laps -= rhs.m_laps;
405 return get_this_type();
410template <
typename... Types>
414 invoke::invoke_impl::invoke_data<operation::plus, TIMEMORY_API>(m_data, rhs.
m_data);
415 m_laps += rhs.m_laps;
416 return get_this_type();
421template <
typename... Types>
425 invoke::invoke_impl::invoke_data<operation::plus, TIMEMORY_API>(m_data, rhs.
m_data);
426 m_laps += rhs.m_laps;
427 return get_this_type();
432template <
typename... Types>
441template <
typename... Types>
450template <
typename... Types>
459template <
typename... Types>
470template <
typename... Types>
476 return get_this_type();
481template <
typename... Types>
485 static thread_local bool _once = []() {
486 apply_v::type_access<operation::init_storage, data_type>();
This is a variadic component wrapper which provides the least amount of runtime and compilation overh...
lightweight_tuple clone(bool store, scope::config _scope=scope::get_default())
this_type & measure(Args &&...)
generic
void set_prefix(const string_t &) const
this_type & reset(Args &&...)
generic
this_type & operator-=(const this_type &rhs)
this_type & pop()
generic pop out of storage
typename bundle_type::data_type data_type
tim::variadic::impl::quirk_config< T, type_list< Types... >, U... > quirk_config
this_type & operator+=(const this_type &rhs)
lightweight_tuple()=default
this_type & push()
generic push into storage
static void init_storage()
requests the component initialize their storage
auto get_labeled(Args &&...) const
generic
this_type & stop(Args &&...)
stop all applicable components
typename bundle_type::string_t string_t
this_type & set_scope(scope::config)
set scope configuration
T * get()
get member functions taking either a type
data_type & data()
get tuple
this_type & record(Args &&...)
generic
this_type & sample(Args &&...)
generic
this_type & start(Args &&...)
start all applicable components
#define IF_CONSTEXPR(...)
hash_map_ptr_t & get_hash_ids()
void set_scope(TupleT< Tp... > &obj, Args &&... args)
void set_prefix(TupleT< Tp... > &obj, Args &&... args)
void record(TupleT< Tp... > &obj, Args &&... args)
void pop(TupleT< Tp... > &obj, Args &&... args)
auto get(TupleT< Tp... > &obj, Args &&... args)
void stop(TupleT< Tp... > &obj, Args &&... args)
void measure(TupleT< Tp... > &obj, Args &&... args)
void push(TupleT< Tp... > &obj, Args &&... args)
auto get_labeled(TupleT< Tp... > &obj, Args &&... args)
void reset(TupleT< Tp... > &obj, Args &&... args)
void start(TupleT< Tp... > &obj, Args &&... args)
impl::filter_false_after_decay_t< trait::is_available, type_list< Types... > > implemented_t
filter out any types that are not available
decltype(auto) get_reference_tuple(Tp &&_tuple)
impl::filter_false< trait::is_available, T > available_t
typename impl::subtract< LhsT, RhsT >::type subtract_t
Ret invoke(string_view_t &&label, Func &&func, Args &&... args)
std::bitset< scope_count > data_type
A light-weight alternative to std::function. Pass any callback - including capturing lambdas - cheapl...
void init(Args &&... args)
typename impl::convert< T, U >::type convert_t
void consume_parameters(ArgsT &&...)
lightweight tuple-alternative for meta-programming logic
a variadic type which holds zero or more quirks that are passed to the constructor of a component bun...
this data type encodes the options of storage scope. The default is hierarchical (tree) scope....