ParamTree Class Reference

Classes to read parameters. More...

#include <param.h>

Collaboration diagram for ParamTree:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ParamTree (const char *name_, const char *value_=(char *) NULL)
 Constructor for a new node.
 ParamTree (ParamTree &PT)
 Copy-Constructor.
 ~ParamTree ()
 Destructor.
void add (const char *name_, const char *value_=(const char *) NULL)
 Add's a new node in the tree.
const char * get (const char *name_)
 Get's the value of a parameter from the tree.
void dump (ostream &out)
 Print's the whole tree.

Public Attributes

ParamTreeleft
 Left and right tree.
ParamTreeright
const char * name
 Name of the parameter in this node.
const char * value
 Value of the parameter in this node.

Detailed Description

Classes to read parameters.

A binary tree to represent and quick find read parameters.

Definition at line 16 of file param.h.


Constructor & Destructor Documentation

ParamTree::ParamTree ( const char *  name_,
const char *  value_ = (char*)NULL 
) [inline]

Constructor for a new node.

Parameters:
name_ Name of the parameter, not NULL !.
value_ Value of the parameter, default is NULL.
See also:
ParamTree(ParamTree&)

Definition at line 35 of file param.h.

ParamTree::ParamTree ( ParamTree PT  )  [inline]

Copy-Constructor.

Copys name, value and the left and right tree.

Parameters:
PT The ParamTree to copy.
See also:
ParamTree()

Definition at line 48 of file param.h.

ParamTree::~ParamTree (  ) 

Destructor.

Deletes the left and right tree, name and value.


Member Function Documentation

void ParamTree::add ( const char *  name_,
const char *  value_ = (const char *) NULL 
)

Add's a new node in the tree.

If a node for this name still exist's, the value will be overwritten.

Parameters:
name_ The name of the parameter to add to the tree.
value_ The value of the parameter to add to the tree, default is NULL.
const char* ParamTree::get ( const char *  name_  ) 

Get's the value of a parameter from the tree.

Parameters:
name_ The name of the parameter to look for.
Returns:
The value of the parameter. If it doesn't exist, returns NULL.
void ParamTree::dump ( ostream &  out  ) 

Print's the whole tree.

Print's the left tree, the root and the right tree.

Parameters:
out The ostream to print to, default is out_log.

Member Data Documentation

Left and right tree.

Definition at line 20 of file param.h.

Definition at line 20 of file param.h.

const char* ParamTree::name

Name of the parameter in this node.

Definition at line 24 of file param.h.

const char* ParamTree::value

Value of the parameter in this node.

Definition at line 28 of file param.h.


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

Generated on 10 Mar 2013 for LaGO by  doxygen 1.6.1