33#include "timemory/backends/process.hpp"
34#include "timemory/backends/threading.hpp"
51template <
typename... Types>
63template <
typename Toolset,
typename Arg,
typename... Args>
67template <
typename Toolset>
71template <
typename Toolset>
87template <typename Tp, bool PlaceHolder = concepts::is_placeholder<Tp>::value>
100 static thread_local bool _instance =
false;
112 static bool matches(
const char* _ckey,
const char* _enum_str,
const idset_t& _ids)
114 static bool _debug = tim::get_env<bool>(
"TIMEMORY_DEBUG",
false);
115 static const auto regex_consts = std::regex_constants::ECMAScript |
116 std::regex_constants::icase |
117 std::regex_constants::optimize;
119 _opts.reserve(_opts.size() + 512);
120 for(
const auto& itr : _ids)
128 if(std::regex_search(_ckey, std::regex{ _option, regex_consts }))
134 "[component::static_properties::matches] '%s' matches (%s) "
136 _ckey, _opts.c_str(), _doption.c_str());
141 }
catch(std::regex_error& err)
144 PRINT_HERE(
"regex error in regex_match(\"%s\", regex{ \"%s\", egrep | icase "
145 "| optimize }): %s [real: %s]",
146 _ckey, _doption.c_str(), err.what(), _option.c_str());
159template <
typename Tp>
171 "static_properties is instantiating a placeholder type");
173 return vtype::matches(_key, ptype::enum_string(), ptype::ids());
179template <
typename Tp>
183 static bool matches(
const char*) {
return false; }
212template <
typename Tp>
220 static constexpr const char*
enum_string() {
return "TIMEMORY_COMPONENTS_END"; }
221 static constexpr const char*
id() {
return ""; }
223 template <
typename Archive>
263 static constexpr bool value =
false;
#define TIMEMORY_COMPONENTS_END
opaque get_opaque(Arg &&arg, Args &&... args)
std::set< size_t > get_typeids()
typename enumerator< Idx >::type enumerator_t
typename enumerator< Idx >::type properties_t
std::set< std::string > idset_t
tim::mpl::apply< std::string > string
This is a critical specialization for mapping string and integers to component types at runtime (shou...
bool operator==(int) const
bool operator==(const std::string &) const
bool operator==(const char *) const
static constexpr bool value
provides nothing, used for dummy types in enum
This is a critical specialization for mapping string and integers to component types at runtime....
static constexpr const char * enum_string()
static constexpr const char * id()
void serialize(Archive &, const unsigned int)
TIMEMORY_COMPONENT value_type
TIMEMORY_COMPONENT operator()()
static constexpr bool specialized()
static constexpr TIMEMORY_COMPONENT value
static bool & has_storage()
static bool matches(const char *_key)
static bool matches(const std::string &_key)
static bool matches(int _idx)
static bool matches(const std::string &)
static bool matches(const char *)
static bool matches(const char *_ckey, const char *_enum_str, const idset_t &_ids)
Provides three variants of a matches function for determining if a component is identified by a given...
concept that specifies that a type is not necessarily marked as not available but is still a dummy ty...
#define TIMEMORY_TESTING_EXCEPTION(...)