lib45d
45Drives C++ Library Development Documentation
Public Member Functions | Public Attributes | Private Attributes | List of all members
ffd::ConfigNode Class Reference

Class for config_map_ entries. More...

#include <45d/config/ConfigNode.hpp>

Public Member Functions

 ConfigNode (std::string value, std::unordered_map< std::string, ConfigNode > *sub_map)
 Construct a new ConfigNode object. More...
 
 ConfigNode (void)
 Construct a new empty ConfigNode object. More...
 
 ConfigNode (const ConfigNode &other)
 Copy construct a new ConfigNode object. More...
 
 ConfigNode (ConfigNode &&other)
 Move constructor. More...
 
ConfigNodeoperator= (ConfigNode &&other)
 Assignment move constructor. More...
 
 ~ConfigNode ()
 Destroy the ConfigNode object. More...
 

Public Attributes

std::string value_
 string from config file after '='
 
std::unordered_map< std::string, ConfigNode > * sub_map_
 Pointer to submap for config sections.
 

Private Attributes

bool is_copy_
 Set in copy constructor to avoid double deletion of *sub_map_.
 

Detailed Description

Class for config_map_ entries.

Constructor & Destructor Documentation

◆ ConfigNode() [1/4]

ffd::ConfigNode::ConfigNode ( std::string  value,
std::unordered_map< std::string, ConfigNode > *  sub_map 
)
inline

Construct a new ConfigNode object.

Parameters
valueString containing config value or subsection header
sub_mapnullptr or pointer to an std::unordered_map<std::string, ffd::ConfigNode> if subsection

◆ ConfigNode() [2/4]

ffd::ConfigNode::ConfigNode ( void  )
inline

Construct a new empty ConfigNode object.

◆ ConfigNode() [3/4]

ffd::ConfigNode::ConfigNode ( const ConfigNode other)
inline

Copy construct a new ConfigNode object.

Sets is_copy_ flag to prevent double deletion of *sub_map_

Parameters
otherConfigNode to be copied

◆ ConfigNode() [4/4]

ffd::ConfigNode::ConfigNode ( ConfigNode &&  other)
inline

Move constructor.

Move value_ and sub_map_ from other to this, and null out sub_map_ pointer in other

Parameters
otherConfigNode to be moved

◆ ~ConfigNode()

ffd::ConfigNode::~ConfigNode ( )
inline

Destroy the ConfigNode object.

Deletes the sub_map_ member if allocated and not a copy

Member Function Documentation

◆ operator=()

ConfigNode& ffd::ConfigNode::operator= ( ConfigNode &&  other)
inline

Assignment move constructor.

Move value_ and sub_map_ from other to this, and null out sub_map_ pointer in other

Parameters
otherConfigNode to be moved
Returns
ConfigNode& *this

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