HoverRace  2.0
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
HoverRace::Util::yaml::MapNode Class Reference

#include <MapNode.h>

+ Inheritance diagram for HoverRace::Util::yaml::MapNode:

Public Types

using const_iterator = children_t::const_iterator
 
using iterator = children_t::iterator
 
using value_type = children_t::value_type
 

Public Member Functions

 MapNode (yaml_document_t *doc, yaml_node_t *node)
 Constructor. More...
 
virtual ~MapNode ()
 Destructor. More...
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator end () const
 
iterator end ()
 
NodeGet (const std::string &key) const
 Retrieve the child node for a given key. More...
 
void ReadBool (const std::string &key, bool &dest) const
 
void ReadDouble (const std::string &key, double &dest, double min, double max) const
 
void ReadFloat (const std::string &key, float &dest, float min, float max) const
 
void ReadInt (const std::string &key, int &dest, int min=INT_MIN, int max=INT_MAX) const
 
void ReadPath (const std::string &key, OS::path_t &dest) const
 
void ReadString (const std::string &key, std::string &dest) const
 Retrieve an optional child node as a string. More...
 
- Public Member Functions inherited from HoverRace::Util::yaml::Node
 Node (yaml_document_t *doc, yaml_node_t *node)
 
virtual ~Node ()
 

Private Types

using children_t = std::map< std::string, Node * >
 
using SUPER = Node
 

Private Member Functions

void Init () const
 Lazy initialization of the child nodes. More...
 

Private Attributes

children_tchildren
 

Additional Inherited Members

- Protected Member Functions inherited from HoverRace::Util::yaml::Node
yaml_document_t * GetDocument () const
 
yaml_node_t * GetNode () const
 

Member Typedef Documentation

using HoverRace::Util::yaml::MapNode::const_iterator = children_t::const_iterator
using HoverRace::Util::yaml::MapNode::iterator = children_t::iterator
using HoverRace::Util::yaml::MapNode::value_type = children_t::value_type

Constructor & Destructor Documentation

HoverRace::Util::yaml::MapNode::MapNode ( yaml_document_t *  doc,
yaml_node_t *  node 
)

Constructor.

Parameters
docThe containing document.
nodeThe underlying LibYAML node (may not be NULL).
HoverRace::Util::yaml::MapNode::~MapNode ( )
virtual

Destructor.

Member Function Documentation

MapNode::const_iterator HoverRace::Util::yaml::MapNode::begin ( ) const
MapNode::iterator HoverRace::Util::yaml::MapNode::begin ( )
MapNode::const_iterator HoverRace::Util::yaml::MapNode::end ( ) const
MapNode::iterator HoverRace::Util::yaml::MapNode::end ( )
Node * HoverRace::Util::yaml::MapNode::Get ( const std::string &  key) const

Retrieve the child node for a given key.

Parameters
keyThe key to look up.
Returns
A Node instance or NULL if the key was not found.
void HoverRace::Util::yaml::MapNode::Init ( ) const
private

Lazy initialization of the child nodes.

void HoverRace::Util::yaml::MapNode::ReadBool ( const std::string &  key,
bool &  dest 
) const
void HoverRace::Util::yaml::MapNode::ReadDouble ( const std::string &  key,
double &  dest,
double  min,
double  max 
) const
void HoverRace::Util::yaml::MapNode::ReadFloat ( const std::string &  key,
float &  dest,
float  min,
float  max 
) const
void HoverRace::Util::yaml::MapNode::ReadInt ( const std::string &  key,
int &  dest,
int  min = INT_MIN,
int  max = INT_MAX 
) const
void HoverRace::Util::yaml::MapNode::ReadPath ( const std::string &  key,
OS::path_t dest 
) const
void HoverRace::Util::yaml::MapNode::ReadString ( const std::string &  key,
std::string &  dest 
) const

Retrieve an optional child node as a string.

If the child node does not exist or is not a scalar, then dest will not be changed.

Parameters
keyThe key to look up.
destThe destination string.

Member Data Documentation

children_t* HoverRace::Util::yaml::MapNode::children
mutableprivate

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