CbmRoot
Loading...
Searching...
No Matches
Yaml.h File Reference
#include "BaseTypes.h"
#include "Definitions.h"
#include "Property.h"
#include "compat/Filesystem.h"
#include "util/EnumDict.h"
#include <sstream>
#include <string_view>
#include <fmt/format.h>
#include <yaml-cpp/yaml.h>
Include dependency graph for Yaml.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cbm::algo::yaml::GetFmtTag< T, typename >
 
struct  cbm::algo::yaml::GetFmtTag< T, std::void_t< decltype(T::FormatAs)> >
 
struct  cbm::algo::yaml::ShouldMergeProperty< T, typename >
 
struct  cbm::algo::yaml::ShouldMergeProperty< T, std::void_t< decltype(T::MergeProperty)> >
 
class  cbm::algo::yaml::Dump
 

Namespaces

namespace  cbm
 
namespace  cbm::algo
 
namespace  cbm::algo::yaml
 

Macros

#define CBM_YAML_EXTERN_DECL(type)
 Declare the external instantiation of the Read and Dump functions for a type.
 
#define CBM_YAML_INSTANTIATE(type)
 Explicitly instantiate the Read and Dump functions for a type.
 

Functions

template<typename T >
cbm::algo::yaml::Read (const YAML::Node &node)
 
template<typename T , T... Values, typename Func >
constexpr void cbm::algo::yaml::ForEach (std::integer_sequence< T, Values... >, Func &&func)
 
template<typename T >
cbm::algo::yaml::ReadFromFile (fs::path path)
 
template<typename T >
std::string cbm::algo::yaml::MakeDocString (int indent=0)
 

Macro Definition Documentation

◆ CBM_YAML_EXTERN_DECL

#define CBM_YAML_EXTERN_DECL ( type)
Value:
extern template type cbm::algo::yaml::Read<type>(const YAML::Node& node); \
extern template std::string cbm::algo::yaml::Dump::operator()<type>(const type& value, int floatPrecision)
T Read(const YAML::Node &node)
Definition Yaml.h:59

Declare the external instantiation of the Read and Dump functions for a type.

Parameters
typeThe type to declare the external instantiation for.
Note
This macro should be used in a header file to declare the external instantiation of the Read and Dump. Must be paired with CBM_YAML_INSTANTIATE in a source file.

Definition at line 297 of file Yaml.h.

◆ CBM_YAML_INSTANTIATE

#define CBM_YAML_INSTANTIATE ( type)
Value:
template type cbm::algo::yaml::Read<type>(const YAML::Node& node); \
template std::string cbm::algo::yaml::Dump::operator()<type>(const type& value, int floatPrecision);

Explicitly instantiate the Read and Dump functions for a type.

See also
CBM_YAML_EXTERN_DECL

Definition at line 305 of file Yaml.h.