30#include "timemory/tpls/cereal/cereal.hpp"
40template <
typename Tp,
size_t Sz>
72 template <
typename Up>
76 template <
typename Up>
80 template <
typename Up>
84 template <
typename Up>
118 template <
typename ArchiveT>
121 ar(cereal::make_nvp(
"value", value));
147 template <
typename Up>
148 auto plus(Up&& rhs) ->
decltype((void) std::forward<Up>(rhs).get_value(), void())
153 template <
typename Up>
154 auto minus(Up&& rhs) ->
decltype((void) std::forward<Up>(rhs).get_value(), void())
160 template <
typename Up>
161 auto multiply(Up&& rhs) ->
decltype((void) std::forward<Up>(rhs).get_value(), void())
167 template <
typename Up>
168 auto divide(Up&& rhs) ->
decltype((void) std::forward<Up>(rhs).get_value(), void())
187template <
typename Tp>
190 template <
typename Up,
typename ValueT>
214 template <
typename ArchiveT>
217 ar(cereal::make_nvp(
"value", value), cereal::make_nvp(
"accum", accum));
222 return (is_transient) ? accum : value;
226 return (is_transient) ? accum : value;
253 template <
typename Up>
254 auto plus(Up&& rhs) ->
decltype((void) std::forward<Up>(rhs).get_value(),
255 (void) std::forward<Up>(rhs).get_accum(), void())
261 template <
typename Up>
262 auto minus(Up&& rhs) ->
decltype((void) std::forward<Up>(rhs).get_value(),
263 (void) std::forward<Up>(rhs).get_accum(), void())
271 template <
typename Up>
272 auto multiply(Up&& rhs) ->
decltype((void) std::forward<Up>(rhs).get_value(),
273 (void) std::forward<Up>(rhs).get_accum(), void())
281 template <
typename Up>
282 auto divide(Up&& rhs) ->
decltype((void) std::forward<Up>(rhs).get_value(),
283 (void) std::forward<Up>(rhs).get_accum(), void())
306template <
typename Tp>
309 template <
typename Up,
typename ValueT>
332 template <
typename ArchiveT>
335 ar(cereal::make_nvp(
"value", value), cereal::make_nvp(
"accum", accum),
336 cereal::make_nvp(
"last", last));
341 return (is_transient) ? accum : value;
345 return (is_transient) ? accum : value;
372 template <
typename Up>
373 auto plus(Up&& rhs) ->
decltype((void) std::forward<Up>(rhs).get_value(),
374 (void) std::forward<Up>(rhs).get_accum(), void())
380 template <
typename Up>
381 auto minus(Up&& rhs) ->
decltype((void) std::forward<Up>(rhs).get_value(),
382 (void) std::forward<Up>(rhs).get_accum(), void())
390 template <
typename Up>
391 auto multiply(Up&& rhs) ->
decltype((void) std::forward<Up>(rhs).get_value(),
392 (void) std::forward<Up>(rhs).get_accum(), void())
400 template <
typename Up>
401 auto divide(Up&& rhs) ->
decltype((void) std::forward<Up>(rhs).get_value(),
402 (void) std::forward<Up>(rhs).get_accum(), void())
458 TIMEMORY_INLINE
bool get_is_flat()
const {
return test<FlatIdx>(); }
483template <
typename Tp,
typename ValueT>
486template <
typename Tp>
487struct base_data<Tp, void>
492template <
typename Tp>
498template <
typename Tp>
499struct base_data<Tp, null_type>
504template <
typename Tp,
typename ValueT>
507 static constexpr auto has_accum = trait::base_has_accum<Tp>::value;
508 static constexpr auto has_last = trait::base_has_last<Tp>::value;
509 static constexpr size_t array_size = 1 + ((has_accum) ? 1 : 0) + ((has_last) ? 1 : 0);
513 static_assert(!(has_last && !has_accum),
"Error! base cannot have last w/o accum");
518template <
typename Tp,
typename ValueT>
typename internal::base_data< Tp, ValueT >::type base_data_t
void divide(const value_type &)
base_data(const base_data &)=default
void plus(const value_type &)
value_type get_last() const
value_type get_accum() const
value_type load(bool) const
void set_accum(value_type)
base_data & operator=(base_data &&)=default
void minus(const value_type &)
void multiply(const value_type &)
void set_last(value_type)
base_data(base_data &&)=default
base_data & operator=(const base_data &)=default
void set_value(value_type)
value_type get_value() const
void serialize(ArchiveT &ar, const unsigned int=0)
auto divide(Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(), void())
base_data & operator=(const base_data &)=default
base_data & operator=(base_data &&)=default
void multiply(const value_type &lhs)
void plus(const value_type &lhs)
void set_accum(value_type)
void set_value(value_type v)
const value_type & load(bool) const
const value_type & get_value() const
auto minus(Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(), void())
void minus(const value_type &lhs)
const value_type & get_last() const
base_data(base_data &&)=default
auto multiply(Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(), void())
void set_last(value_type)
const value_type & get_accum() const
auto plus(Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(), void())
void divide(const value_type &lhs)
base_data(const base_data &)=default
base_data & operator=(const base_data &rhs)=default
void set_last(value_type)
void plus(const value_type &rhs)
void set_value(value_type v)
auto multiply(Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(),(void) std::forward< Up >(rhs).get_accum(), void())
base_data(const base_data &rhs)=default
auto minus(Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(),(void) std::forward< Up >(rhs).get_accum(), void())
const value_type & get_value() const
void multiply(const value_type &rhs)
void minus(const value_type &rhs)
const value_type & load(bool is_transient) const
base_data(base_data &&)=default
value_type & load(bool is_transient)
const value_type & get_accum() const
void divide(const value_type &rhs)
auto divide(Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(),(void) std::forward< Up >(rhs).get_accum(), void())
base_data & operator=(base_data &&)=default
void set_accum(value_type v)
const value_type & get_last() const
void serialize(ArchiveT &ar, const unsigned int=0)
auto plus(Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(),(void) std::forward< Up >(rhs).get_accum(), void())
const value_type & get_value() const
base_data(const base_data &rhs)=default
void set_accum(value_type v)
value_type & load(bool is_transient)
void divide(const value_type &rhs)
const value_type & get_accum() const
auto multiply(Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(),(void) std::forward< Up >(rhs).get_accum(), void())
base_data(base_data &&)=default
void set_value(value_type v)
auto minus(Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(),(void) std::forward< Up >(rhs).get_accum(), void())
const value_type & get_last() const
void serialize(ArchiveT &ar, const unsigned int=0)
void set_last(value_type v)
void plus(const value_type &rhs)
auto plus(Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(),(void) std::forward< Up >(rhs).get_accum(), void())
void minus(const value_type &rhs)
auto divide(Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(),(void) std::forward< Up >(rhs).get_accum(), void())
base_data & operator=(const base_data &rhs)=default
base_data & operator=(base_data &&)=default
void multiply(const value_type &rhs)
const value_type & load(bool is_transient) const
Provide state configuration options for a component instance. The current states are:
void set_is_transient(bool v)
void set_is_on_stack(bool v)
bool get_depth_change() const
void set_is_running(bool v)
bool get_is_on_stack() const
bool get_is_transient() const
void set_depth_change(bool v)
bool get_is_running() const
bool get_is_invalid() const
void set_is_invalid(bool v)
static decltype(auto) minus(type &_l, const V &_r)
static decltype(auto) plus(type &_l, const V &_r)
static decltype(auto) multiply(type &_l, const V &_r)
static decltype(auto) divide(type &_l, const V &_r)
this is a placeholder type for optional type-traits. It is used as the default type for the type-trai...