Scarab  v3.7.1
Project 8 C++ Utility Library
Public Types | Public Member Functions | Protected Attributes | List of all members
param_node Class Reference

#include <param_node.hh>

Inheritance diagram for param_node:
Inheritance graph

Public Types

typedef param_node_contents contents
 
typedef param_node_iterator iterator
 
typedef param_node_const_iterator const_iterator
 
typedef contents::value_type contents_type
 

Public Member Functions

 param_node ()
 
 param_node (const param_node &orig)
 
 param_node (param_node &&orig)
 
virtual ~param_node ()
 
param_nodeoperator= (const param_node &rhs)
 
param_nodeoperator= (param_node &&rhs)
 
virtual param_ptr_t clone () const
 
virtual param_ptr_t move_clone ()
 
virtual bool is_null () const
 
virtual bool is_node () const
 
virtual bool has_subset (const param &a_subset) const
 
unsigned size () const
 
bool empty () const
 
bool has (const std::string &a_name) const
 
unsigned count (const std::string &a_name) const
 
std::string get_value (const std::string &a_name, const std::string &a_default) const
 
std::string get_value (const std::string &a_name, const char *a_default) const
 
template<typename XValType >
XValType get_value (const std::string &a_name, XValType a_default) const
 
const paramoperator[] (const std::string &a_name) const
 
paramoperator[] (const std::string &a_name)
 
bool add (const std::string &a_name, const param &a_value)
 
bool add (const std::string &a_name, param &&a_value)
 
bool add (const std::string &a_name, param_ptr_t a_value_ptr)
 
template<typename T , typename std::enable_if< std::is_convertible< T, param_value >::value, T >::type * = nullptr>
bool add (const std::string &a_name, T a_value)
 
void replace (const std::string &a_name, const param &a_value)
 Creates a copy of a_value; overwrites if the key exits. More...
 
void replace (const std::string &a_name, param &&a_value)
 Adds a_value with move semantics; overwrites if the key exists. More...
 
void replace (const std::string &a_name, param_ptr_t a_value_ptr)
 Adds a_value_ptr by directly adding the pointer; overwrites if the key exists. More...
 
template<typename T , typename std::enable_if< std::is_convertible< T, param_value >::value, T >::type * = nullptr>
void replace (const std::string &a_name, T a_value)
 Adds a_value as a param_valuefor any type that param_value accepts. More...
 
void merge (const param_node &a_object)
 
void erase (const std::string &a_name)
 
param_ptr_t remove (const std::string &a_name)
 
void clear ()
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
virtual std::string to_string () const
 
- Public Member Functions inherited from param
 param ()
 
 param (const param &orig)
 
 param (param &&orig)
 
virtual ~param ()
 
paramoperator= (const param &rhs)
 
paramoperator= (param &&)
 
virtual bool is_value () const
 
virtual bool is_array () const
 
param_valueas_value ()
 
param_arrayas_array ()
 
param_nodeas_node ()
 
const param_valueas_value () const
 
const param_arrayas_array () const
 
const param_nodeas_node () const
 
const param_valueoperator() () const
 Assumes that the parameter is a value, and returns a reference to itself. More...
 
param_valueoperator() ()
 Assumes that the parameter is a value, and returns a reference to itself. More...
 
const paramoperator[] (unsigned a_index) const
 
paramoperator[] (unsigned a_index)
 
const paramoperator[] (const std::string &a_name) const
 
paramoperator[] (const std::string &a_name)
 
std::string get_value (const std::string &a_name, const std::string &a_default) const
 
std::string get_value (const std::string &a_name, const char *a_default) const
 
template<typename XValType >
XValType get_value (const std::string &a_name, XValType a_default) const
 
std::string get_value (unsigned a_index, const std::string &a_default) const
 
std::string get_value (unsigned a_index, const char *a_default) const
 
template<typename XValType >
XValType get_value (unsigned a_index, XValType a_default) const
 
void merge (const param &a_param)
 

Protected Attributes

contents f_contents
 

Additional Inherited Members

- Static Public Attributes inherited from param
static unsigned s_indent_level = 0
 

Detailed Description

Definition at line 69 of file param_node.hh.

Member Typedef Documentation

◆ const_iterator

Definition at line 74 of file param_node.hh.

◆ contents

Definition at line 72 of file param_node.hh.

◆ contents_type

typedef contents::value_type contents_type

Definition at line 75 of file param_node.hh.

◆ iterator

Definition at line 73 of file param_node.hh.

Constructor & Destructor Documentation

◆ param_node() [1/3]

Definition at line 23 of file param_node.cc.

◆ param_node() [2/3]

param_node ( const param_node orig)

Definition at line 29 of file param_node.cc.

◆ param_node() [3/3]

param_node ( param_node &&  orig)

Definition at line 39 of file param_node.cc.

◆ ~param_node()

~param_node ( )
virtual

Definition at line 50 of file param_node.cc.

Member Function Documentation

◆ add() [1/4]

bool add ( const std::string &  a_name,
const param a_value 
)
inline

Adds a copy of a_value Only adds and returns true if a_name is not already present, and returns false if it is.

Definition at line 228 of file param_node.hh.

◆ add() [2/4]

bool add ( const std::string &  a_name,
param &&  a_value 
)
inline

Adds a_value with move semantics Only adds and returns true if a_name is not already present, and returns false if it is.

Definition at line 239 of file param_node.hh.

◆ add() [3/4]

bool add ( const std::string &  a_name,
param_ptr_t  a_value_ptr 
)
inline

Adds a_value_ptr by directly adding the pointer Only adds and returns true if a_name is not already present, and returns false if it is.

Definition at line 250 of file param_node.hh.

◆ add() [4/4]

bool add ( const std::string &  a_name,
a_value 
)
inline

Adds a_value as a param_value for any type that param_value accepts Only adds and returns true if a_name is not already present, and returns false if it is.

Definition at line 262 of file param_node.hh.

◆ begin() [1/2]

param_node::iterator begin ( )
inline

Definition at line 328 of file param_node.hh.

◆ begin() [2/2]

param_node::const_iterator begin ( ) const
inline

Definition at line 333 of file param_node.hh.

◆ clear()

void clear ( )
inline

Definition at line 322 of file param_node.hh.

◆ clone()

param_ptr_t clone ( ) const
inlinevirtual

Reimplemented from param.

Definition at line 168 of file param_node.hh.

◆ count()

unsigned count ( const std::string &  a_name) const
inline

Definition at line 203 of file param_node.hh.

◆ empty()

bool empty ( ) const
inline

Definition at line 193 of file param_node.hh.

◆ end() [1/2]

param_node::iterator end ( )
inline

Definition at line 338 of file param_node.hh.

◆ end() [2/2]

param_node::const_iterator end ( ) const
inline

Definition at line 343 of file param_node.hh.

◆ erase()

void erase ( const std::string &  a_name)
inline

Definition at line 300 of file param_node.hh.

◆ get_value() [1/3]

std::string get_value ( const std::string &  a_name,
const std::string &  a_default 
) const
inline

Returns the result of param_value::get if a_name is present and is of type param_value Returns a_default if a_name is not present or is not of type param_value

Definition at line 208 of file param_node.hh.

◆ get_value() [2/3]

std::string get_value ( const std::string &  a_name,
const char *  a_default 
) const
inline

Definition at line 213 of file param_node.hh.

◆ get_value() [3/3]

XValType get_value ( const std::string &  a_name,
XValType  a_default 
) const
inline

Returns the result of param_value::get if a_name is present and is of type param_value Returns a_default if a_name is not present or is not of type param_value

Definition at line 163 of file param_node.hh.

◆ has()

bool has ( const std::string &  a_name) const
inline

Definition at line 198 of file param_node.hh.

◆ has_subset()

bool has_subset ( const param a_subset) const
virtual

Reimplemented from param.

Definition at line 77 of file param_node.cc.

◆ is_node()

bool is_node ( ) const
inlinevirtual

Reimplemented from param.

Definition at line 184 of file param_node.hh.

◆ is_null()

bool is_null ( ) const
inlinevirtual

Reimplemented from param.

Definition at line 179 of file param_node.hh.

◆ merge()

void merge ( const param_node a_object)

Merges the contents of a_object into this object. If names in the contents of a_object exist in this object, the values in this object corresponding to the matching names will be replaced.

Definition at line 90 of file param_node.cc.

◆ move_clone()

param_ptr_t move_clone ( )
inlinevirtual

Reimplemented from param.

Definition at line 174 of file param_node.hh.

◆ operator=() [1/2]

param_node & operator= ( const param_node rhs)

Definition at line 54 of file param_node.cc.

◆ operator=() [2/2]

param_node & operator= ( param_node &&  rhs)

Definition at line 65 of file param_node.cc.

◆ operator[]() [1/2]

const param & operator[] ( const std::string &  a_name) const
inline

Returns a reference to the param corresponding to a_name. Throws an std::out_of_range if a_name is not present.

Definition at line 218 of file param_node.hh.

◆ operator[]() [2/2]

param & operator[] ( const std::string &  a_name)
inline

Returns a reference to the param corresponding to a_name. Throws an std::out_of_range if a_name is not present.

Definition at line 223 of file param_node.hh.

◆ remove()

param_ptr_t remove ( const std::string &  a_name)
inline

Definition at line 310 of file param_node.hh.

◆ replace() [1/4]

void replace ( const std::string &  a_name,
const param a_value 
)
inline

Creates a copy of a_value; overwrites if the key exits.

Definition at line 274 of file param_node.hh.

◆ replace() [2/4]

void replace ( const std::string &  a_name,
param &&  a_value 
)
inline

Adds a_value with move semantics; overwrites if the key exists.

Definition at line 280 of file param_node.hh.

◆ replace() [3/4]

void replace ( const std::string &  a_name,
param_ptr_t  a_value_ptr 
)
inline

Adds a_value_ptr by directly adding the pointer; overwrites if the key exists.

Definition at line 286 of file param_node.hh.

◆ replace() [4/4]

void replace ( const std::string &  a_name,
a_value 
)
inline

Adds a_value as a param_valuefor any type that param_value accepts.

Definition at line 293 of file param_node.hh.

◆ size()

unsigned size ( ) const
inline

Definition at line 189 of file param_node.hh.

◆ to_string()

std::string to_string ( ) const
virtual

Reimplemented from param.

Definition at line 127 of file param_node.cc.

Member Data Documentation

◆ f_contents

contents f_contents
protected

Definition at line 157 of file param_node.hh.


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