70 return sfinae_str(obj, 0, 0, 0,
_prefix);
75 return sfinae_hash(obj, 0, _nhash);
81 TIMEMORY_INLINE
auto sfinae_str(U& obj,
int,
int,
int,
const string_t&
_prefix)
const
82 ->
decltype(obj.set_prefix(
_prefix))
87 template <
typename U,
typename S>
88 TIMEMORY_HOT
auto sfinae_str(U& obj,
int,
int,
long,
const S&
_prefix)
const
89 ->
decltype(obj.set_prefix(
_prefix.c_str()))
91 return obj.set_prefix(
_prefix.c_str());
94 template <
typename U,
typename S>
95 TIMEMORY_HOT
auto sfinae_str(U& obj,
int,
long,
long,
const S&
_prefix)
const
96 ->
decltype(obj.set_prefix(
_prefix.data()))
98 return obj.set_prefix(
_prefix.data());
102 template <
typename U>
103 TIMEMORY_INLINE
void sfinae_str(U&,
long,
long,
long,
const string_t&)
const
108 template <
typename U>
109 TIMEMORY_HOT
auto sfinae_hash(U& obj,
int,
hash_value_t _nhash)
const
110 ->
decltype(obj.set_prefix(_nhash))
112 return obj.set_prefix(_nhash);
116 template <
typename U>
117 TIMEMORY_INLINE
void sfinae_hash(U&,
long,
hash_value_t)
const
123template <
typename Tp>
126 sfinae_str(obj, 0, 0, 0,
_prefix);
131template <
typename Tp>
134 sfinae_hash(obj, 0, _nhash);
135 sfinae_str(obj, 0, 0, 0,
_prefix);
144template <
typename Tp>
155 return sfinae(obj, 0, _data);
160 template <
typename T>
161 TIMEMORY_HOT
auto sfinae(T& obj,
int,
scope::config _data)
const
162 ->
decltype(obj.set_scope(_data))
164 return obj.set_scope(_data);
168 template <
typename T>
175template <
typename Tp>
178 sfinae(obj, 0, _data);
187template <
typename Tp>
198 return sfinae(obj, 0, _data);
203 template <
typename T>
205 ->
decltype(obj.set_state(_data))
207 return obj.set_state(_data);
211 template <
typename T>
218template <
typename Tp>
221 sfinae(obj, 0, _data);
226template <
typename Tp>
231 template <
typename Up>
234 static_assert(!std::is_pointer<Up>::value,
235 "SFINAE tests will always fail with pointer types");
236 return sfinae(obj, 0, v);
242 template <
typename Up>
243 static TIMEMORY_HOT
auto sfinae(Up& obj,
int,
bool v)
244 ->
decltype(obj.set_depth_change(v))
246 return obj.set_depth_change(v);
249 template <
typename Up>
250 static TIMEMORY_INLINE
auto sfinae(Up&,
long,
bool)
253 template <
typename Up>
254 constexpr auto sfinae(
int)
const
255 ->
decltype(std::declval<Up>().set_depth_change(std::declval<bool>()), bool())
260 template <
typename Up>
261 constexpr bool sfinae(
long)
const
269template <
typename Tp>
272 TIMEMORY_DEFAULT_OBJECT(set_is_flat)
274 template <
typename Up>
277 static_assert(!std::is_pointer<Up>::value,
278 "SFINAE tests will always fail with pointer types");
279 return sfinae(obj, 0, v);
285 template <
typename Up>
286 static TIMEMORY_HOT
auto sfinae(Up& obj,
int,
bool v) ->
decltype(obj.set_is_flat(v))
288 return obj.set_is_flat(v);
291 template <
typename Up>
292 static TIMEMORY_INLINE
auto sfinae(Up&,
long,
bool)
295 template <
typename Up>
296 constexpr auto sfinae(
int)
const
297 ->
decltype(std::declval<Up>().set_is_flat(std::declval<bool>()), bool())
302 template <
typename Up>
303 constexpr bool sfinae(
long)
const
311template <
typename Tp>
312struct set_is_on_stack
314 TIMEMORY_DEFAULT_OBJECT(set_is_on_stack)
316 template <
typename Up>
319 static_assert(!std::is_pointer<Up>::value,
320 "SFINAE tests will always fail with pointer types");
321 return sfinae(obj, 0, v);
325 template <
typename Up>
326 static TIMEMORY_HOT
auto sfinae(Up& obj,
int,
bool v)
327 ->
decltype(obj.set_is_on_stack(v))
329 return obj.set_is_on_stack(v);
332 template <
typename Up>
333 static TIMEMORY_INLINE
auto sfinae(Up&,
long,
bool)
339template <
typename Tp>
342 TIMEMORY_DEFAULT_OBJECT(set_is_invalid)
344 template <
typename Up>
347 static_assert(!std::is_pointer<Up>::value,
348 "SFINAE tests will always fail with pointer types");
349 return sfinae(obj, 0, v);
355 template <
typename Up>
356 static TIMEMORY_HOT
auto sfinae(Up& obj,
int,
bool v)
357 ->
decltype(obj.set_is_invalid(v))
359 return obj.set_is_invalid(v);
362 template <
typename Up>
363 static TIMEMORY_INLINE
auto sfinae(Up&,
long,
bool)
366 template <
typename Up>
367 constexpr auto sfinae(
int)
const
368 ->
decltype(std::declval<Up>().set_is_invalid(std::declval<bool>()), bool())
373 template <
typename Up>
374 constexpr bool sfinae(
long)
const
382template <
typename Tp>
385 TIMEMORY_DEFAULT_OBJECT(set_iterator)
387 template <
typename Up>
390 return sfinae(obj, 0, std::forward<Up>(v));
394 template <
typename ObjT,
typename ItrT>
395 TIMEMORY_HOT
auto sfinae(ObjT& obj,
int, ItrT&& v)
396 ->
decltype(std::declval<ObjT>().set_iterator(std::forward<ItrT>(v)))
398 return obj.set_iterator(std::forward<ItrT>(v));
401 template <
typename ObjT,
typename ItrT>
402 TIMEMORY_INLINE
auto sfinae(ObjT&,
long, ItrT&&)
408template <
typename Tp>
411 TIMEMORY_DEFAULT_OBJECT(set_is_running)
413 template <
typename Up>
416 static_assert(!std::is_pointer<Up>::value,
417 "SFINAE tests will always fail with pointer types");
418 return sfinae(obj, 0, v);
422 template <
typename Up>
423 static TIMEMORY_HOT
auto sfinae(Up& obj,
int,
bool v)
424 ->
decltype(obj.set_is_running(v))
426 return obj.set_is_running(v);
429 template <
typename Up>
430 static TIMEMORY_INLINE
auto sfinae(Up&,
long,
bool)
char const std::string & _prefix
std::string string_view_t
The declaration for the types for operations without definitions.
Include the macros for operations.
Declare the operations types.
Provide state configuration options for a component instance. The current states are:
This operation attempts to call a member function which the component provides to internally store wh...
auto operator()(Up &obj, bool v) const
constexpr auto operator()() const
auto operator()(Up &obj, bool v) const
constexpr auto operator()() const
constexpr auto operator()() const
auto operator()(Up &obj, bool v) const
auto operator()(Up &obj, bool v) const
auto operator()(Up &obj, bool v) const
auto operator()(Tp &obj, Up &&v)
Call the set_prefix member function. These instantiations are always inlined because of the use of st...
set_prefix(type &obj, const string_t &_prefix)
auto operator()(type &obj, const string_t &_prefix) const
auto operator()(type &obj, hash_value_t _nhash) const
set_scope(type &obj, scope::config _data)
auto operator()(type &obj, scope::config _data) const
set_state(type &obj, component::base_state *_data)
auto operator()(type &obj, component::base_state *_data)
this data type encodes the options of storage scope. The default is hierarchical (tree) scope....