CbmRoot
Loading...
Searching...
No Matches
CbmYaml.h File Reference
#include "CbmEnumDict.h"
#include "CbmYamlBaseTypes.h"
#include "CbmYamlProperty.h"
#include <boost/filesystem.hpp>
#include <iostream>
#include <sstream>
#include <string_view>
#include <fmt/format.h>
#include <yaml-cpp/yaml.h>
Include dependency graph for CbmYaml.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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

Namespaces

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

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.
 

Typedefs

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

Functions

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

Macro Definition Documentation

◆ CBM_YAML_EXTERN_DECL

#define CBM_YAML_EXTERN_DECL ( type)
Value:
extern template type cbm::util::yaml::Read<type>(const YAML::Node& node); \
extern template std::string cbm::util::yaml::Dump::operator()<type>(const type& value, int floatPrecision); \
extern template void cbm::util::yaml::Dump::DoDump<type>(const type& object, YAML::Emitter& ss, \
std::optional<YAML::EMITTER_MANIP> formatEntries);
void DoDump(const T &object, YAML::Emitter &ss, std::optional< YAML::EMITTER_MANIP > formatEntries={})
Definition CbmYaml.h:232
T Read(const YAML::Node &node)
Definition CbmYaml.h:74

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 342 of file CbmYaml.h.

◆ CBM_YAML_INSTANTIATE

#define CBM_YAML_INSTANTIATE ( type)
Value:
template type cbm::util::yaml::Read<type>(const YAML::Node& node); \
template std::string cbm::util::yaml::Dump::operator()<type>(const type& value, int floatPrecision); \
template void cbm::util::yaml::Dump::DoDump<type>(const type& object, YAML::Emitter& ss, \
std::optional<YAML::EMITTER_MANIP> formatEntries);

Explicitly instantiate the Read and Dump functions for a type.

See also
CBM_YAML_EXTERN_DECL

Definition at line 352 of file CbmYaml.h.