NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
Yaml::Node Class Reference

Node class. More...

#include <Yaml.hpp>

Public Types

enum class  eType : int8_t { None , SequenceType , MapType , ScalarType }
 Enumeration of node types. More...
 

Public Member Functions

 Node ()
 Default constructor. More...
 
 Node (const Node &node)
 Copy constructor. More...
 
 Node (const std::string &value)
 Assignment constructors. Converts node to scalar type if needed. More...
 
 Node (const char *value)
 
 ~Node ()
 Destructor. More...
 
eType Type () const
 Functions for checking type of node. More...
 
bool IsNone () const
 
bool IsSequence () const
 
bool IsMap () const
 
bool IsScalar () const
 
void Clear ()
 Completely clear node. More...
 
template<typename T >
As () const
 Get node as given template type. More...
 
template<typename T >
As (const T &defaultValue) const
 Get node as given template type. More...
 
size_t Size () const
 Get size of node. Serialization of type None or Scalar will return 0. More...
 
NodeInsert (size_t index)
 Insert sequence item at given index. Converts node to sequence type if needed. Adding new item to end of sequence if index is larger than sequence size. More...
 
NodePushFront ()
 Add new sequence index to back. Converts node to sequence type if needed. More...
 
NodePushBack ()
 Add new sequence index to front. Converts node to sequence type if needed. More...
 
Nodeoperator[] (size_t index)
 Get sequence/map item. Converts node to sequence/map type if needed. More...
 
Nodeoperator[] (const std::string &key)
 
void Erase (size_t index)
 Erase item. No action if node is not a sequence or map. More...
 
void Erase (const std::string &key)
 
Nodeoperator= (const Node &node)
 Assignment operators. More...
 
Nodeoperator= (const std::string &value)
 
Nodeoperator= (const char *value)
 
Iterator Begin ()
 Get start iterator. More...
 
ConstIterator Begin () const
 
Iterator End ()
 Get end iterator. More...
 
ConstIterator End () const
 

Friends

class Iterator
 

Detailed Description

Node class.

Member Enumeration Documentation

◆ eType

enum Yaml::Node::eType : int8_t
strong

Enumeration of node types.

Enumerator
None 
SequenceType 
MapType 
ScalarType 

Constructor & Destructor Documentation

◆ Node() [1/4]

Yaml::Node::Node ( )

Default constructor.

◆ Node() [2/4]

Yaml::Node::Node ( const Node node)

Copy constructor.

◆ Node() [3/4]

Yaml::Node::Node ( const std::string &  value)
explicit

Assignment constructors. Converts node to scalar type if needed.

References magic_enum::detail::value().

Here is the call graph for this function:

◆ Node() [4/4]

Yaml::Node::Node ( const char *  value)
explicit

References magic_enum::detail::value().

Here is the call graph for this function:

◆ ~Node()

Yaml::Node::~Node ( )

Destructor.

Member Function Documentation

◆ As() [1/2]

template<typename T >
T Yaml::Node::As ( ) const
inline

Get node as given template type.

References Yaml::impl::StringConverter< T >::Get().

Here is the call graph for this function:

◆ As() [2/2]

template<typename T >
T Yaml::Node::As ( const T &  defaultValue) const
inline

Get node as given template type.

References Yaml::impl::StringConverter< T >::Get().

Here is the call graph for this function:

◆ Begin() [1/2]

Iterator Yaml::Node::Begin ( )

Get start iterator.

References Yaml::IteratorImp::InitBegin(), MapType, NODE_IMP, SequenceType, and TYPE_IMP.

Here is the call graph for this function:

◆ Begin() [2/2]

ConstIterator Yaml::Node::Begin ( ) const

References Yaml::IteratorImp::InitBegin(), MapType, NODE_IMP, SequenceType, and TYPE_IMP.

Here is the call graph for this function:

◆ Clear()

void Yaml::Node::Clear ( )

Completely clear node.

References NODE_IMP.

Referenced by Yaml::Iterator::operator*(), Yaml::ConstIterator::operator*(), operator[](), and Yaml::ParseImp::Parse().

Here is the caller graph for this function:

◆ End() [1/2]

Iterator Yaml::Node::End ( )

Get end iterator.

References Yaml::IteratorImp::InitEnd(), MapType, NODE_IMP, SequenceType, and TYPE_IMP.

Here is the call graph for this function:

◆ End() [2/2]

ConstIterator Yaml::Node::End ( ) const

References Yaml::IteratorImp::InitEnd(), MapType, NODE_IMP, SequenceType, and TYPE_IMP.

Here is the call graph for this function:

◆ Erase() [1/2]

void Yaml::Node::Erase ( const std::string &  key)

References MapType, NODE_IMP, and TYPE_IMP.

◆ Erase() [2/2]

void Yaml::Node::Erase ( size_t  index)

Erase item. No action if node is not a sequence or map.

References index, NODE_IMP, SequenceType, and TYPE_IMP.

◆ Insert()

Node & Yaml::Node::Insert ( size_t  index)

Insert sequence item at given index. Converts node to sequence type if needed. Adding new item to end of sequence if index is larger than sequence size.

References index, NODE_IMP, and TYPE_IMP.

◆ IsMap()

bool Yaml::Node::IsMap ( ) const

References MapType, and NODE_IMP.

◆ IsNone()

bool Yaml::Node::IsNone ( ) const

References NODE_IMP, and None.

◆ IsScalar()

bool Yaml::Node::IsScalar ( ) const

References NODE_IMP, and ScalarType.

◆ IsSequence()

bool Yaml::Node::IsSequence ( ) const

References NODE_IMP, and SequenceType.

◆ operator=() [1/3]

Node & Yaml::Node::operator= ( const char *  value)

References NODE_IMP, TYPE_IMP, and magic_enum::detail::value().

Here is the call graph for this function:

◆ operator=() [2/3]

Node & Yaml::Node::operator= ( const Node node)

Assignment operators.

References NODE_IMP.

◆ operator=() [3/3]

Node & Yaml::Node::operator= ( const std::string &  value)

References NODE_IMP, TYPE_IMP, and magic_enum::detail::value().

Here is the call graph for this function:

◆ operator[]() [1/2]

Node & Yaml::Node::operator[] ( const std::string &  key)

References NODE_IMP, and TYPE_IMP.

◆ operator[]() [2/2]

Node & Yaml::Node::operator[] ( size_t  index)

Get sequence/map item. Converts node to sequence/map type if needed.

Parameters
indexSequence index. Returns None type Node if index is unknown.
keyMap key. Creates a new node if key is unknown.

References Clear(), index, NODE_IMP, and TYPE_IMP.

Here is the call graph for this function:

◆ PushBack()

Node & Yaml::Node::PushBack ( )

Add new sequence index to front. Converts node to sequence type if needed.

References NODE_IMP, and TYPE_IMP.

◆ PushFront()

Node & Yaml::Node::PushFront ( )

Add new sequence index to back. Converts node to sequence type if needed.

References NODE_IMP, and TYPE_IMP.

◆ Size()

size_t Yaml::Node::Size ( ) const

Get size of node. Serialization of type None or Scalar will return 0.

References TYPE_IMP.

◆ Type()

Node::eType Yaml::Node::Type ( ) const

Functions for checking type of node.

References NODE_IMP.

Friends And Related Function Documentation

◆ Iterator

friend class Iterator
friend

The documentation for this class was generated from the following files: