60template <
typename Tag,
typename CompT,
typename BundleT>
68 "Error! The first template parameter of an 'BundleT' must "
69 "statisfy the 'is_api' concept");
85 static constexpr bool has_gotcha_v = component_type::has_gotcha_v;
86 static constexpr bool has_user_bundle_v = component_type::has_user_bundle_v;
89 template <
typename T,
typename... U>
91 tim::variadic::impl::quirk_config<T, convert_t<BundleT, type_list<>>, U...>;
112 template <
typename... T>
114 transient_func_t = get_initializer());
116 template <
typename... T>
118 transient_func_t = get_initializer());
122 transient_func_t = get_initializer());
127 transient_func_t = get_initializer());
131 transient_func_t = get_initializer());
136 template <
typename Arg,
typename... Args>
140 template <
typename Arg,
typename... Args>
144 template <
typename Arg,
typename... Args>
156 static constexpr std::size_t
size() {
return component_type::size(); }
169 static constexpr auto fixed_count() {
return component_type::fixed_count(); }
171 static constexpr auto optional_count() {
return component_type::optional_count(); }
173 auto count() {
return (m_enabled) ? m_temporary.count() : 0; }
176 template <
typename FuncT,
typename... Args>
177 decltype(
auto)
execute(FuncT&& func, Args&&... args)
180 std::forward<FuncT>(func)(std::forward<Args>(args)...));
184 template <
typename... Args>
188 template <
typename... Args>
192 template <
typename... Args>
196 template <
typename... Args>
200 template <
typename... Args>
204 template <
typename... Args>
208 template <
typename... Args>
213 template <
typename... Args>
218 template <
typename... Args>
222 template <
typename... Args>
226 template <
typename... Args>
230 template <
typename... Args>
234 template <
typename... Args>
238 template <
typename... Args>
242 template <
typename... Args>
246 template <
typename... Args>
250 template <
typename... Args>
254 template <
typename... Args>
258 template <
template <
typename>
class OpT,
typename... Args>
262 template <
typename... Args>
263 auto get(Args&&... args)
const
265 return m_temporary.get(std::forward<Args>(args)...);
270 template <
typename... Args>
273 return m_temporary.get_labeled(std::forward<Args>(args)...);
280 bool report_at_exit()
const;
286 int64_t laps()
const;
289 uint64_t hash()
const;
301 this_type& report_at_exit(
bool val);
307 this_type& rekey(captured_location_t _loc);
310 this_type& rekey(uint64_t _hash);
320 template <
typename Tp,
typename... Args>
323 m_temporary.template init<Tp>(std::forward<Args>(args)...);
326 template <
typename... Tp,
typename... Args>
329 m_temporary.template
initialize<Tp...>(std::forward<Args>(args)...);
332 template <
typename... Tail>
335 template <
typename Tp,
typename... Args>
336 decltype(
auto)
get(Args&&... args)
338 return m_temporary.template get<Tp>(std::forward<Args>(args)...);
341 template <
typename Tp,
typename... Args>
342 decltype(
auto)
get(Args&&... args)
const
344 return m_temporary.template get<Tp>(std::forward<Args>(args)...);
347 void get(
void*& ptr,
size_t hash)
const { m_temporary.get(ptr, hash); }
349 template <
typename T>
351 ->
decltype(std::declval<component_type>().template get_component<T>())
353 return m_temporary.template get_component<T>();
356 decltype(
auto)
get_data()
const {
return m_temporary.get_data(); }
360 m_temporary += rhs.m_temporary;
366 m_temporary -= rhs.m_temporary;
381 void internal_init(transient_func_t _init);
383 template <
typename Arg,
typename... Args>
384 void internal_init(transient_func_t _init, Arg&& _arg, Args&&...
_args);
387 bool m_enabled =
true;
388 bool m_report_at_exit =
false;
394 this_type& get_this_type()
const
396 return const_cast<this_type&
>(
static_cast<const this_type&
>(*this));
void get(void *&ptr, size_t hash) const
this_type & assemble(Args &&... args)
invoke assemble member function on all components to determine if measurements can be derived from ot...
this_type & start(Args &&... args)
invoke start member function on all components
decltype(auto) get(Args &&... args)
this_type & store(Args &&... args)
invoke store member function on all components
typename base_type::component_type component_type
this_type & record(Args &&... args)
record some data
this_type & operator+=(const this_type &rhs)
typename component_type::data_type data_type
this_type & mark_end(Args &&... args)
invoke mark_begin member function on all components
decltype(auto) execute(FuncT &&func, Args &&... args)
when chaining together operations, this enables executing a function inside the chain
this_type & set_scope(Args &&... args)
modify the scope of the push operation
const component_type & get_component() const
this_type & push(Args &&... args)
push components into call-stack storage
this_type & operator-=(const this_type &rhs)
this_type & mark_begin(Args &&... args)
invoke mark_begin member function on all components
auto get(Args &&... args) const
invoke get member function on all components to get their data
decltype(auto) get_data() const
typename component_type::bundle_type bundle_type
this_type & measure(Args &&... args)
execute a measurement
static constexpr std::size_t size()
this_type & pop(Args &&... args)
pop components off call-stack storage
auto_base_bundle(string_view_cref_t, bool store, scope::config _scope, transient_func_t, Arg &&, Args &&...)
tim::variadic::impl::quirk_config< T, convert_t< BundleT, type_list<> >, U... > quirk_config
convert_t< BundleT, CompT > base_type
auto get_component() -> decltype(std::declval< component_type >().template get_component< T >())
this_type & audit(Args &&... args)
invoke audit member function on all components
this_type & reset(Args &&... args)
reset the data
typename component_type::sample_type sample_type
static constexpr auto optional_count()
query the number of (run-time) optional components
static void init_storage()
component_type & get_component()
auto init(Args &&... args)
auto_base_bundle(auto_base_bundle &&)=default
typename component_type::tuple_type tuple_type
auto_base_bundle(const captured_location_t &, bool store, scope::config _scope, transient_func_t, Arg &&, Args &&...)
auto initialize(Args &&... args)
this_type & set_prefix(Args &&... args)
set the key
static initializer_type & get_initializer()
static constexpr auto fixed_count()
query the number of (compile-time) fixed components
this_type & invoke(Args &&... _args)
invoke the provided operation on all components
this_type & stop(Args &&... args)
invoke stop member function on all components
static initializer_type & get_finalizer()
component_type m_temporary
this_type & sample(Args &&... args)
execute a sample
auto_base_bundle & operator=(auto_base_bundle &&)=default
this_type & add_secondary(Args &&... args)
add secondary data
this_type & derive(Args &&... args)
invoke derive member function on all components to extract measurements from other components in the ...
auto count()
count number of active components in an instance
friend this_type operator-(const this_type &lhs, const this_type &rhs)
this_type & mark(Args &&... args)
invoke mark member function on all components
friend this_type operator+(const this_type &lhs, const this_type &rhs)
auto_base_bundle(size_t, bool store, scope::config _scope, transient_func_t, Arg &&, Args &&...)
auto_base_bundle & operator=(const auto_base_bundle &)=default
std::function< void(this_type &)> initializer_type
decltype(auto) get(Args &&... args) const
auto_base_bundle(const auto_base_bundle &)=default
typename component_type::captured_location_t captured_location_t
auto get_labeled(Args &&... args) const
invoke get member function on all components to get data labeled with component name
component_type value_type
void store(TupleT< Tp... > &obj, Args &&... args)
auto execute(BundleT &&_bundle, FuncT &&_func, Args &&... _args, enable_if_t< is_invocable< FuncT, Args... >::value &&!std::is_void< std::result_of_t< FuncT(Args...)> >::value, int >)
std::bitset< scope_count > data_type
A light-weight alternative to std::function. Pass any callback - including capturing lambdas - cheapl...
std::array< char *, 4 > _args
void initialize(CompList< CompTypes... > &obj, std::initializer_list< EnumT > components)
const std::string & string_view_cref_t
tim::mpl::apply< std::string > string
typename impl::convert< T, U >::type convert_t
Static polymorphic base class for automatic start/stop bundlers.
concept that specifies that a type is an API. APIs are used to designate different project implementa...
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....