48template <
typename Tp,
typename Value>
49template <typename Vp, typename Up, enable_if_t<trait::sampler<Up>::value,
int>>
53 auto _storage =
static_cast<storage_type*
>(get_storage());
54 assert(_storage !=
nullptr);
56 _storage->add_sample(std::forward<Vp>(_obj));
65template <
typename Tp,
typename Value>
66template <
typename Up,
typename Unit,
67 enable_if_t<std::is_same<Unit, int64_t>::value,
int>>
80template <
typename Tp,
typename Value>
81template <
typename Up,
typename Unit,
82 enable_if_t<std::is_same<Unit, std::string>::value,
int>>
94template <
typename Tp,
typename Value>
95template <
typename Up,
typename Unit,
96 enable_if_t<std::is_same<Unit, int64_t>::value,
int>>
100 static int64_t _instance = []() {
101 auto _value = Type::unit();
123template <
typename Tp,
typename Value>
124template <
typename Up,
typename Unit,
125 enable_if_t<std::is_same<Unit, std::string>::value,
int>>
129 static std::string _instance = Type::display_unit();
135 if(!_unit_setting.empty())
145 if(!_unit_setting.empty())
156template <
typename Tp,
typename Value>
157template <
typename Up>
171#include "timemory/tpls/cereal/cereal.hpp"
178template <
typename Tp,
typename Value>
179template <
typename Up>
184 operation::base_printer<Up>(
os,
static_cast<const Up&
>(*
this));
189template <
typename Tp,
typename Value>
190template <
typename Archive,
typename Up,
191 enable_if_t<!trait::custom_serialization<Up>::value,
int>>
195 operation::serialization<Type>(
static_cast<const Type&
>(*
this), ar, version);
198template <
typename Tp,
typename Value>
199template <
typename Archive,
typename Up,
200 enable_if_t<!trait::custom_serialization<Up>::value,
int>>
204 auto try_catch = [](Archive& arch,
const char* key,
auto& val) {
207 arch(cereal::make_nvp(key, val));
208 }
catch(cereal::Exception& e)
211 fprintf(stderr,
"Warning! '%s' threw exception: %s\n", key, e.what());
217 try_catch(ar,
"laps", laps);
219 set_is_transient(
true);
Definition for various functions for base_printer in operations.
Declare the base component types.
#define IF_CONSTEXPR(...)
typename std::enable_if< B, T >::type enable_if_t
void serialize(std::string fname, exec_data< Counter > &obj)
std::tuple< std::string, int64_t > get_timing_unit(std::string _unit)
std::string mem_repr(int64_t _unit)
std::string time_repr(int64_t _unit)
std::tuple< std::string, int64_t > get_memory_unit(std::string _unit)
tim::mpl::apply< std::string > string
const std::string std::ostream * os
The declaration for the types for storage without definitions.
static int64_t get_unit()
void save(Archive &ar, unsigned int version) const
serialization store (output)
static std::string display_unit()
static std::string get_display_unit()
static void add_sample(Vp &&)
void print(std::ostream &, enable_if_t< trait::uses_value_storage< Up, Value >::value, int >=0) const
static constexpr bool value