CbmRoot
Loading...
Searching...
No Matches
cbm::algo::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_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_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 FundamentalTypes
 

Functions

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 >
 
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)
 

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
 
template<typename T >
constexpr bool IsSet = is_std_set<T>::value || is_std_unordered_set<T>::value
 

Typedef Documentation

◆ FundamentalTypes

Initial value:
std::tuple< bool
, u8, i8
, u16, i16
, u32, i32
, u64, i64
, f32, f64
, std::string
>
std::int64_t i64
Definition Definitions.h:22
std::int32_t i32
Definition Definitions.h:20
float f32
Definition Definitions.h:24
std::uint32_t u32
Definition Definitions.h:21
std::uint64_t u64
Definition Definitions.h:23
std::uint8_t u8
Definition Definitions.h:17
std::int16_t i16
Definition Definitions.h:18
std::int8_t i8
Definition Definitions.h:16
double f64
Definition Definitions.h:25
std::uint16_t u16
Definition Definitions.h:19

Definition at line 20 of file BaseTypes.h.

Function Documentation

◆ ForEach()

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

Definition at line 25 of file Yaml.h.

Referenced by MakeDocString(), and Read().

◆ MakeDocString()

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

Definition at line 151 of file Yaml.h.

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

◆ Property()

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

◆ Read()

template<typename T >
T cbm::algo::yaml::Read ( const YAML::Node & node)

◆ ReadFromFile()

◆ Typename()

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

Definition at line 51 of file BaseTypes.h.

Referenced by MakeDocString().

Variable Documentation

◆ IsArray

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

Definition at line 108 of file BaseTypes.h.

Referenced by MakeDocString(), and Read().

◆ IsEnum

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

Definition at line 45 of file BaseTypes.h.

Referenced by Read().

◆ IsFundamental

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

Definition at line 42 of file BaseTypes.h.

Referenced by MakeDocString(), and Read().

◆ IsMap

template<typename T >
bool cbm::algo::yaml::IsMap = is_std_map<T>::value
constexpr

Definition at line 119 of file BaseTypes.h.

Referenced by Read().

◆ IsScalar

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

Definition at line 48 of file BaseTypes.h.

Referenced by Read().

◆ IsSet

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

Definition at line 138 of file BaseTypes.h.

Referenced by Read().

◆ IsVector

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

Definition at line 97 of file BaseTypes.h.

Referenced by MakeDocString(), and Read().