29#include "timemory/tpls/cereal/archives.hpp"
35#if defined(DISABLE_TIMEMORY) || defined(TIMEMORY_DISABLED) || \
36 (defined(TIMEMORY_ENABLED) && TIMEMORY_ENABLED == 0)
41template <
typename... Types,
typename... Args>
64template <
typename Tp,
typename FuncT>
75 using policy_type = policy::output_archive_t<decay_t<Tp>>;
77 oa->setNextName(_main_name.c_str());
80 (*oa)(cereal::make_nvp(_data_name.c_str(), obj));
101template <
typename ArchiveT,
typename ApiT = TIMEMORY_API,
typename Tp,
typename FuncT>
109 "Error! Not an output archive type");
114 using policy_type = policy::output_archive<ArchiveT, ApiT>;
116 oa->setNextName(_main_name.c_str());
119 (*oa)(cereal::make_nvp(_data_name.c_str(), obj));
140template <
typename ArchiveT,
typename ApiT = TIMEMORY_API,
typename Tp,
typename FuncT>
143 std::ostream& ofs,
const Tp& obj,
const std::string& _main_name =
"timemory",
148 using policy_type = policy::output_archive<ArchiveT, ApiT>;
151 if(!_main_name.empty())
153 oa->setNextName(_main_name.c_str());
160 (*oa)(cereal::make_nvp(_data_name, obj));
162 if(!_main_name.empty())
bool open(std::ofstream &_ofs, std::string _fpath, Args &&... _args)
typename std::decay< T >::type decay_t
Alias template for decay.
void generic_serialization(const std::string &fname, const Tp &obj, const std::string &_main_name="timemory", const std::string &_data_name="data", FuncT &&_func=[](typename policy::output_archive_t< decay_t< Tp > >::type &) {})
tim::mpl::apply< std::string > string
auto get(const auto_bundle< Tag, Types... > &_obj)
static constexpr bool value
Provides a static get() function which return a shared pointer to an instance of the given archive fo...