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

#include <param.hh>

Inheritance diagram for param_node:
Inheritance graph

Public Types

typedef std::map< std::string, param * > contents
 
typedef contents::iterator iterator
 
typedef contents::const_iterator const_iterator
 
typedef contents::value_type contents_type
 

Public Member Functions

 param_node ()
 
 param_node (const param_node &orig)
 
virtual ~param_node ()
 
param_nodeoperator= (const param_node &rhs)
 
virtual paramclone () const
 
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
 
template<typename XValType >
XValType get_value (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 paramat (const std::string &a_name) const
 
paramat (const std::string &a_name)
 
const param_valuevalue_at (const std::string &a_name) const
 
param_valuevalue_at (const std::string &a_name)
 
const param_arrayarray_at (const std::string &a_name) const
 
param_arrayarray_at (const std::string &a_name)
 
const param_nodenode_at (const std::string &a_name) const
 
param_nodenode_at (const std::string &a_name)
 
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)
 creates a copy of a_value More...
 
bool add (const std::string &a_name, param *a_value_ptr)
 directly adds (without copying) a_value_ptr More...
 
void replace (const std::string &a_name, const param &a_value)
 creates a copy of a_value More...
 
void replace (const std::string &a_name, param *a_value_ptr)
 directly adds (without copying) a_value_ptr More...
 
void merge (const param_node &a_object)
 
void erase (const std::string &a_name)
 
paramremove (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)
 
virtual ~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)
 

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 300 of file param.hh.

Member Typedef Documentation

typedef contents::const_iterator const_iterator

Definition at line 305 of file param.hh.

typedef std::map< std::string, param* > contents

Definition at line 303 of file param.hh.

typedef contents::value_type contents_type

Definition at line 306 of file param.hh.

typedef contents::iterator iterator

Definition at line 304 of file param.hh.

Constructor & Destructor Documentation

Definition at line 441 of file param.cc.

param_node ( const param_node orig)

Definition at line 447 of file param.cc.

~param_node ( )
virtual

Definition at line 457 of file param.cc.

Member Function Documentation

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

creates a copy of a_value

Definition at line 1120 of file param.hh.

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

directly adds (without copying) a_value_ptr

Definition at line 1131 of file param.hh.

const param_array * array_at ( const std::string &  a_name) const
inline

Definition at line 1065 of file param.hh.

param_array * array_at ( const std::string &  a_name)
inline

Definition at line 1075 of file param.hh.

const param * at ( const std::string &  a_name) const
inline

Returns a pointer to the param corresponding to a_name. Returns NULL if a_name is not present.

Definition at line 1025 of file param.hh.

param * at ( const std::string &  a_name)
inline

Returns a pointer to the param corresponding to a_name. Returns NULL if a_name is not present.

Definition at line 1035 of file param.hh.

param_node::iterator begin ( )
inline

Definition at line 1189 of file param.hh.

param_node::const_iterator begin ( ) const
inline

Definition at line 1194 of file param.hh.

void clear ( )
inline

Definition at line 1179 of file param.hh.

param * clone ( ) const
inlinevirtual

Reimplemented from param.

Definition at line 970 of file param.hh.

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

Definition at line 1001 of file param.hh.

bool empty ( ) const
inline

Definition at line 990 of file param.hh.

param_node::iterator end ( )
inline

Definition at line 1199 of file param.hh.

param_node::const_iterator end ( ) const
inline

Definition at line 1204 of file param.hh.

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

Definition at line 1156 of file param.hh.

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

Returns the result of ParamValue::get if a_name is present and is of type ParamValue Throws an error if a_name is not present or is not of type ParamValue

Definition at line 1006 of file param.hh.

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

Returns the result of ParamValue::get if a_name is present and is of type ParamValue Throws an error if a_name is not present or is not of type ParamValue

Definition at line 955 of file param.hh.

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

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

Definition at line 1013 of file param.hh.

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

Definition at line 1020 of file param.hh.

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

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

Definition at line 963 of file param.hh.

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

Definition at line 996 of file param.hh.

bool has_subset ( const param a_subset) const
virtual

Reimplemented from param.

Definition at line 472 of file param.cc.

bool is_node ( ) const
inlinevirtual

Reimplemented from param.

Definition at line 981 of file param.hh.

bool is_null ( ) const
inlinevirtual

Reimplemented from param.

Definition at line 976 of file param.hh.

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 485 of file param.cc.

const param_node * node_at ( const std::string &  a_name) const
inline

Definition at line 1085 of file param.hh.

param_node * node_at ( const std::string &  a_name)
inline

Definition at line 1095 of file param.hh.

param_node & operator= ( const param_node rhs)

Definition at line 462 of file param.cc.

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

Returns a reference to the param corresponding to a_name. Throws an error if a_name is not present.

Definition at line 1105 of file param.hh.

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

Returns a reference to the param corresponding to a_name. Adds a new value if a_name is not present.

Definition at line 1115 of file param.hh.

param * remove ( const std::string &  a_name)
inline

Definition at line 1167 of file param.hh.

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

creates a copy of a_value

Definition at line 1142 of file param.hh.

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

directly adds (without copying) a_value_ptr

Definition at line 1149 of file param.hh.

unsigned size ( ) const
inline

Definition at line 986 of file param.hh.

std::string to_string ( ) const
virtual

Reimplemented from param.

Definition at line 520 of file param.cc.

const param_value * value_at ( const std::string &  a_name) const
inline

Definition at line 1045 of file param.hh.

param_value * value_at ( const std::string &  a_name)
inline

Definition at line 1055 of file param.hh.

Member Data Documentation

contents f_contents
protected

Definition at line 395 of file param.hh.


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