CbmRoot
Loading...
Searching...
No Matches
cbm::util::yaml Namespace Reference

Classes

class  Dump
 
struct  GetFmtTag
 
struct  GetFmtTag< T, std::void_t< decltype(T::FormatAs)> >
 
struct  has_type
 
struct  has_type< T, std::tuple< Us... > >
 
struct  is_optional
 
struct  is_optional< std::optional< T > >
 
struct  is_std_array
 
struct  is_std_array< std::array< T, N > >
 
struct  is_std_map
 
struct  is_std_map< std::map< K, V, C, A > >
 
struct  is_std_set
 
struct  is_std_set< std::set< K, C, A > >
 
struct  is_std_unordered_map
 
struct  is_std_unordered_map< std::unordered_map< K, V, H, E, A > >
 
struct  is_std_unordered_set
 
struct  is_std_unordered_set< std::unordered_set< K, H, E, A > >
 
struct  is_std_vector
 
struct  is_std_vector< std::vector< T, A > >
 
class  Property
 
struct  ShouldMergeProperty
 
struct  ShouldMergeProperty< T, std::void_t< decltype(T::MergeProperty)> >
 

Typedefs

using i8 = int8_t
 
using u8 = uint8_t
 
using i16 = int16_t
 
using u16 = uint16_t
 
using i32 = int32_t
 
using u32 = uint32_t
 
using i64 = int64_t
 
using u64 = uint64_t
 
using f32 = float
 
using f64 = double
 
using FundamentalTypes
 

Functions

template<typename T>
Read (const YAML::Node &node)
 
template<typename T, T... Values, typename Func>
constexpr void ForEach (std::integer_sequence< T, Values... >, Func &&func)
 
template<typename T>
ReadFromFile (fs::path path)
 
template<typename T>
std::string MakeDocString (int indent=0)
 
template<typename T, typename = std::enable_if_t<IsFundamental<T>>>
constexpr std::string_view Typename ()
 
template<typename Class, typename T>
 Property (T Class::*member, std::string_view key, std::string_view description) -> Property< Class, T >
 

Variables

template<typename T>
constexpr bool IsFundamental = has_type<T, FundamentalTypes>::value
 
template<typename T>
constexpr bool IsEnum = std::is_enum_v<T>
 
template<typename T>
constexpr bool IsScalar = IsFundamental<T> || IsEnum<T>
 
template<typename T>
constexpr bool IsVector = is_std_vector<T>::value
 
template<typename T>
constexpr bool IsArray = is_std_array<T>::value
 
template<typename T>
constexpr bool IsMap = is_std_map<T>::value || is_std_unordered_map<T>::value
 
template<typename T>
constexpr bool IsSet = is_std_set<T>::value || is_std_unordered_set<T>::value
 
template<typename T>
constexpr bool IsOptional = is_optional<T>::value
 

Typedef Documentation

◆ f32

using cbm::util::yaml::f32 = float

Definition at line 33 of file CbmYaml.h.

◆ f64

using cbm::util::yaml::f64 = double

Definition at line 34 of file CbmYaml.h.

◆ FundamentalTypes

Initial value:
std::tuple< bool
, u8, i8
, u16, i16
, u32, i32
, u64, i64
, f32, f64
, std::string
>
uint64_t u64
Definition CbmYaml.h:32
int64_t i64
Definition CbmYaml.h:31
uint16_t u16
Definition CbmYaml.h:28
int32_t i32
Definition CbmYaml.h:29
int16_t i16
Definition CbmYaml.h:27
uint32_t u32
Definition CbmYaml.h:30
uint8_t u8
Definition CbmYaml.h:26

Definition at line 35 of file CbmYamlBaseTypes.h.

◆ i16

using cbm::util::yaml::i16 = int16_t

Definition at line 27 of file CbmYaml.h.

◆ i32

using cbm::util::yaml::i32 = int32_t

Definition at line 29 of file CbmYaml.h.

◆ i64

using cbm::util::yaml::i64 = int64_t

Definition at line 31 of file CbmYaml.h.

◆ i8

using cbm::util::yaml::i8 = int8_t

Definition at line 25 of file CbmYaml.h.

◆ u16

using cbm::util::yaml::u16 = uint16_t

Definition at line 28 of file CbmYaml.h.

◆ u32

using cbm::util::yaml::u32 = uint32_t

Definition at line 30 of file CbmYaml.h.

◆ u64

using cbm::util::yaml::u64 = uint64_t

Definition at line 32 of file CbmYaml.h.

◆ u8

using cbm::util::yaml::u8 = uint8_t

Definition at line 26 of file CbmYaml.h.

Function Documentation

◆ ForEach()

template<typename T, T... Values, typename Func>
void cbm::util::yaml::ForEach ( std::integer_sequence< T, Values... > ,
Func && func )
constexpr

Definition at line 40 of file CbmYaml.h.

Referenced by MakeDocString(), and Read().

◆ MakeDocString()

template<typename T>
std::string cbm::util::yaml::MakeDocString ( int indent = 0)

Definition at line 174 of file CbmYaml.h.

References ForEach(), IsArray, IsFundamental, IsVector, and Typename().

◆ Property()

template<typename Class, typename T>
cbm::util::yaml::Property ( T Class::* member,
std::string_view key,
std::string_view description ) -> Property< Class, T >

◆ Read()

◆ ReadFromFile()

◆ Typename()

template<typename T, typename = std::enable_if_t<IsFundamental<T>>>
std::string_view cbm::util::yaml::Typename ( )
constexpr

Definition at line 66 of file CbmYamlBaseTypes.h.

Referenced by MakeDocString().

Variable Documentation

◆ IsArray

template<typename T>
bool cbm::util::yaml::IsArray = is_std_array<T>::value
constexpr

Definition at line 123 of file CbmYamlBaseTypes.h.

Referenced by MakeDocString(), and Read().

◆ IsEnum

template<typename T>
bool cbm::util::yaml::IsEnum = std::is_enum_v<T>
constexpr

Definition at line 60 of file CbmYamlBaseTypes.h.

Referenced by Read().

◆ IsFundamental

template<typename T>
bool cbm::util::yaml::IsFundamental = has_type<T, FundamentalTypes>::value
constexpr

Definition at line 57 of file CbmYamlBaseTypes.h.

Referenced by MakeDocString(), and Read().

◆ IsMap

template<typename T>
bool cbm::util::yaml::IsMap = is_std_map<T>::value || is_std_unordered_map<T>::value
constexpr

Definition at line 142 of file CbmYamlBaseTypes.h.

Referenced by Read().

◆ IsOptional

template<typename T>
bool cbm::util::yaml::IsOptional = is_optional<T>::value
constexpr

Definition at line 172 of file CbmYamlBaseTypes.h.

Referenced by Read().

◆ IsScalar

template<typename T>
bool cbm::util::yaml::IsScalar = IsFundamental<T> || IsEnum<T>
constexpr

Definition at line 63 of file CbmYamlBaseTypes.h.

Referenced by Read().

◆ IsSet

template<typename T>
bool cbm::util::yaml::IsSet = is_std_set<T>::value || is_std_unordered_set<T>::value
constexpr

Definition at line 161 of file CbmYamlBaseTypes.h.

Referenced by Read().

◆ IsVector

template<typename T>
bool cbm::util::yaml::IsVector = is_std_vector<T>::value
constexpr

Definition at line 112 of file CbmYamlBaseTypes.h.

Referenced by MakeDocString(), and Read().