31 #include <type_traits>
33 #if __cplusplus >= 201703L
34 # include <string_view>
39 #define TIMEMORY_IMPL_IS_CONCEPT(CONCEPT) \
42 template <typename Tp> \
46 template <typename, typename = std::true_type> \
47 struct have : std::false_type \
49 template <typename U> \
50 struct have<U, typename std::is_base_of<typename U::CONCEPT, U>::type> \
53 template <typename U> \
54 struct have<U, typename std::is_base_of<typename U::CONCEPT##_type, U>::type> \
59 using type = typename is_##CONCEPT::template have< \
60 typename std::remove_cv<Tp>::type>::type; \
61 static constexpr bool value = \
62 is_##CONCEPT::template have<typename std::remove_cv<Tp>::type>::value; \
74 class OutputArchiveBase;
75 class InputArchiveBase;
84 using true_type = std::true_type;
85 using false_type = std::false_type;
99 template <
typename Tp>
102 template <
typename Tp>
108 template <
typename Tp>
114 template <
typename Tp>
115 using anonymous_t =
typename anonymous<Tp>::type;
120 template <
size_t Idx,
typename Tag>
123 template <
size_t Nt,
typename ComponentsT,
typename DifferentiatorT = anonymous_t<
void>>
126 template <
typename... Types>
133 template <
typename... Types>
134 class lightweight_tuple;
148 template <
template <
typename...>
class Tuple>
158 template <
template <
typename...>
class Tuple>
181 template <
typename... Types>
205 template <
typename Tp>
210 template <
typename,
typename = std::true_type>
211 struct have : std::false_type
215 template <
typename U>
216 struct have<U,
typename std::is_base_of<typename U::component, U>
::type>
221 template <
typename U>
222 static constexpr decltype(U::is_component,
bool{}) test(
int)
224 return U::is_component;
229 template <
typename Up>
230 static constexpr
bool test(
long)
233 is_component::template have<std::remove_cv_t<Tp>>
::value;
237 static constexpr
bool value = test<Tp>(
int{});
238 using type = std::conditional_t<value, true_type, false_type>;
374 #if __cplusplus >= 201703L
384 template <
typename T>
392 template <
typename T>
400 template <
typename Tp>
405 template <
typename,
typename = std::true_type>
406 struct have : std::false_type
410 template <
typename U>
411 struct have<U,
typename std::is_base_of<output_archive_base, U>
::type>
417 is_output_archive::template have<std::remove_cv_t<Tp>>
::value;
418 using type = std::conditional_t<value, true_type, false_type>;
425 template <
typename Tp>
430 template <
typename,
typename = std::true_type>
431 struct have : std::false_type
435 template <
typename U>
436 struct have<U,
typename std::is_base_of<input_archive_base, U>
::type> : std::true_type
441 is_input_archive::template have<std::remove_cv_t<Tp>>
::value;
442 using type = std::conditional_t<value, true_type, false_type>;
449 template <
typename Tp>
454 using type = std::conditional_t<value, true_type, false_type>;
467 template <
typename Lhs,
typename Rhs>
471 (std::is_same<Lhs, Rhs>::value ||
472 (std::is_integral<Lhs>::value && std::is_integral<Rhs>::value) ||
473 (std::is_floating_point<Lhs>::value && std::is_floating_point<Rhs>::value));
483 template <
typename T>
486 using type =
typename T::tuple_type;
493 template <
typename T>
496 using type =
typename T::auto_type;
504 template <
typename T>
507 using type =
typename T::component_type;
520 template <
typename T>
523 template <
typename T>
526 template <
typename T>
529 template <
typename T>
532 template <
typename T>
541 #if !defined(TIMEMORY_CONCEPT_ALIAS)
542 # define TIMEMORY_CONCEPT_ALIAS(ALIAS, TYPE) \
547 template <typename T> \
548 using ALIAS = typename TYPE<T>::type; \
567 #define TIMEMORY_DEFINE_CONCRETE_CONCEPT(CONCEPT, SPECIALIZED_TYPE, VALUE) \
573 struct CONCEPT<SPECIALIZED_TYPE> : VALUE \
580 #define TIMEMORY_DEFINE_TEMPLATE_CONCEPT(CONCEPT, SPECIALIZED_TYPE, VALUE, TYPE) \
586 struct CONCEPT<SPECIALIZED_TYPE<T>> : VALUE \
593 #define TIMEMORY_DEFINE_VARIADIC_CONCEPT(CONCEPT, SPECIALIZED_TYPE, VALUE, TYPE) \
598 template <TYPE... T> \
599 struct CONCEPT<SPECIALIZED_TYPE<T...>> : VALUE \
606 #define TIMEMORY_DEFINE_CONCRETE_CONCEPT_TYPE(CONCEPT, SPECIALIZED_TYPE, ...) \
612 struct CONCEPT<SPECIALIZED_TYPE> \
614 using type = __VA_ARGS__; \
621 #define TIMEMORY_DEFINE_TEMPLATE_CONCEPT_TYPE(CONCEPT, SPECIALIZED_TYPE, TYPE, ...) \
627 struct CONCEPT<SPECIALIZED_TYPE<T>> \
629 using type = __VA_ARGS__; \
636 #define TIMEMORY_DEFINE_VARIADIC_CONCEPT_TYPE(CONCEPT, SPECIALIZED_TYPE, TYPE, ...) \
641 template <TYPE... T> \
642 struct CONCEPT<SPECIALIZED_TYPE<T...>> \
644 using type = __VA_ARGS__; \
This is a variadic component wrapper which provides the least amount of runtime and compilation overh...
#define TIMEMORY_CONCEPT_ALIAS(ALIAS, TYPE)
#define TIMEMORY_IMPL_IS_CONCEPT(CONCEPT)
typename is_stack_wrapper< T >::type is_stack_wrapper_t
typename is_variadic< T >::type is_variadic_t
typename T::tuple_type type
typename auto_type< T >::type auto_type_t
cereal::detail::InputArchiveBase input_archive_base
typename tuple_type< T >::type tuple_type_t
cereal::detail::OutputArchiveBase output_archive_base
typename is_heap_wrapper< T >::type is_heap_wrapper_t
typename is_empty< T >::type is_empty_t
typename T::component_type type
typename is_wrapper< T >::type is_wrapper_t
typename T::auto_type type
typename component_type< T >::type component_type_t
This concept is used to express how to convert a component bundler into another component bundler whi...
This concept is used to express how to convert a given type into a std::tuple, e.g....
This concept is used to express how to convert a component bundler which automatically starts upon co...
void audit(TupleT< Tp... > &obj, Args &&... args)
typename concepts::is_heap_wrapper< T >::type is_heap_wrapper_t
typename concepts::is_empty< T >::type is_empty_t
typename concepts::is_stack_wrapper< T >::type is_stack_wrapper_t
typename concepts::is_wrapper< T >::type is_wrapper_t
typename concepts::is_variadic< T >::type is_variadic_t
Used by component audit member function to designate the parameters being passed are incoming (e....
Used by component audit member function to designate the parameters being passed are outgoing (e....
determines if a variadic wrapper contains a gotcha component
concept that specifies that a type is a user_bundle type
This concept designates that is safe to perform a static_cast<Lhs>(rhs) where needed....
static constexpr bool value
concept that specifies that a type is a serialization archive (input or output)
std::conditional_t< value, true_type, false_type > type
static constexpr bool value
concept that specifies that a type is a component. Components are used to perform some measurement,...
std::conditional_t< value, true_type, false_type > type
static constexpr bool value
concept that specifies that a variadic type is empty
typename is_empty ::template have< typename std::remove_cv< Tp >::type >::type type
concept that specifies that a type is a timemory variadic wrapper and components are heap-allocated
typename is_heap_wrapper ::template have< typename std::remove_cv< Tp >::type >::type type
concept that specifies that a type is not a useful type
concept that specifies that a type is an output serialization archive
std::conditional_t< value, true_type, false_type > type
static constexpr bool value
concept that specifies that a type is not necessarily marked as not available but is still a dummy ty...
concept that specifies that a type is a timemory variadic wrapper and components are stack-allocated
typename is_stack_wrapper ::template have< typename std::remove_cv< Tp >::type >::type type
concept that specifies that a component type wraps external functions
concept that specifies that a type is a generic variadic wrapper
typename is_variadic ::template have< typename std::remove_cv< Tp >::type >::type type
concept that specifies that a type is a timemory variadic wrapper
typename is_wrapper ::template have< typename std::remove_cv< Tp >::type >::type type
this is a placeholder type for optional type-traits. It is used as the default type for the type-trai...
trait that designates the type is a timemory component
typename typename typename