RTC Toolkit  2.0.0
Classes | Namespaces | Macros | Typedefs | Variables
utils.hpp File Reference

Various utilities for Life Cycle Extension. More...

#include <type_traits>

Go to the source code of this file.

Classes

struct  rtctk::componentFramework::is_base_of_template_impl< Base, Derived >
 
struct  rtctk::componentFramework::is_present< What, Args >
 
struct  rtctk::componentFramework::empty_base< class >
 

Namespaces

 rtctk
 
 rtctk::componentFramework
 

Macros

#define RTCTK_DEFINE_OPTION(Name, DefaultValue)
 
#define RTCTK_APPLY_OPTION_ED(Options, Name)
 
#define RTCTK_IS_OPTION(Name, Value)
 
#define RTCTK_ASSERT_OPTION_ED(Name)
 

Typedefs

using rtctk::componentFramework::Enabled = std::true_type
 
using rtctk::componentFramework::Disabled = std::false_type
 
template<template< typename... > class Base, typename Derived >
using rtctk::componentFramework::is_base_of_template = typename is_base_of_template_impl< Base, Derived >::type
 
template<class T , bool Condition>
using rtctk::componentFramework::optional_base = std::conditional_t< Condition, T, empty_base< T > >
 

Variables

template<template< typename... > class Base, typename Derived >
constexpr bool rtctk::componentFramework::is_base_of_template_v = is_base_of_template<Base, Derived>::value
 
template<typename What , typename... Args>
constexpr bool rtctk::componentFramework::is_present_v = is_present<What, Args...>::value
 

Detailed Description

Various utilities for Life Cycle Extension.

Macro Definition Documentation

◆ RTCTK_APPLY_OPTION_ED

#define RTCTK_APPLY_OPTION_ED (   Options,
  Name 
)
Value:
\
std::conditional_t<is_present_v<Name<Enabled>, Options...>, Name<Enabled>, \
std::conditional_t<is_present_v<Name<Disabled>, Options...>, Name<Disabled>, Name<>>> \

◆ RTCTK_ASSERT_OPTION_ED

#define RTCTK_ASSERT_OPTION_ED (   Name)
Value:
\
static_assert(RTCTK_IS_OPTION(Name, Enabled) or \
"Option " #Name " must either be Enabled or Disabled") \

◆ RTCTK_DEFINE_OPTION

#define RTCTK_DEFINE_OPTION (   Name,
  DefaultValue 
)
Value:
\
template <typename T = DefaultValue> struct Name : T {} \

◆ RTCTK_IS_OPTION

#define RTCTK_IS_OPTION (   Name,
  Value 
)
Value:
\
std::is_base_of_v<Name<Value>, AppliedOptions> \
RTCTK_IS_OPTION
#define RTCTK_IS_OPTION(Name, Value)
Definition: utils.hpp:32
rtctk::componentFramework::Disabled
std::false_type Disabled
Definition: utils.hpp:47
rtctk::componentFramework::Enabled
std::true_type Enabled
Definition: utils.hpp:46