# SmiTreeNode< T > Class Template Reference

Scenario Tree. More...

`#include <SmiScenarioTree.hpp>`

Collaboration diagram for SmiTreeNode< T >:
[legend]

List of all members.

## Public Types
typedef std::map< int, SmiTreeNode< T > * > | child_label_map
## Public Member Functions
bool | hasParent ()
bool | hasChild ()
bool | hasSibling ()
SmiTreeNode< T > * | getParent ()
SmiTreeNode< T > * | getChild ()
SmiTreeNode< T > * | getSibling ()
void | setLastChildLabel (int label)
SmiTreeNode< T > * | getChildByLabel (int n)
int | depth ()
int | numChildren ()
int | scenario ()
void | setScenario (int s)
SmiTreeNode< T > * | addChild (T cd, int scenario)
std::vector< SmiTreeNode< T > * > * | getChildren ()
T | getDataPtr ()
Constructors, destructors and major modifying methods
| SmiTreeNode ()
| Default Constructor creates an empty node.
| SmiTreeNode (T p)
| Constructor from P.
| ~SmiTreeNode ()
| Destructor.
## Protected Member Functions
void | setChild (SmiTreeNode< T > *c)
void | setSibling (SmiTreeNode< T > *s)
SmiTreeNode< T > * | getParentP ()
SmiTreeNode< T > * | getChildP ()
SmiTreeNode< T > * | getSiblingP ()
## Private Attributes
SmiTreeNode< T > * | parent_
SmiTreeNode< T > * | child_
SmiTreeNode< T > * | sibling_
int | scen_
int | nchild_
int | depth_
T | ptr_
child_label_map | child_labels_

## Detailed Description

### template<class T>
class SmiTreeNode< T >

Scenario Tree.

This class is used for storing and accessing scenario trees. SmiTreeNode template class.

Manages pointers to parent, child and sibling for tree navigation. Template class instance is a pointer to an object that must be created with "new" operator.

Definition at line 27 of file SmiScenarioTree.hpp.

## Member Typedef Documentation

template<class T>

typedef std::map<int, SmiTreeNode<T>*> SmiTreeNode< T >::child_label_map

Definition at line 31 of file SmiScenarioTree.hpp.

## Constructor & Destructor Documentation

template<class T>

SmiTreeNode< T >::SmiTreeNode | ( |  | ) | `[inline]`

Default Constructor creates an empty node.

template<class T>

SmiTreeNode< T >::SmiTreeNode | ( | T | p | ) | `[inline]`

Constructor from P.

template<class T>

SmiTreeNode< T >::~SmiTreeNode | ( |  | ) | `[inline]`

Destructor.

## Member Function Documentation

template<class T>

bool SmiTreeNode< T >::hasParent | ( |  | ) | `[inline]`

Definition at line 33 of file SmiScenarioTree.hpp.

template<class T>

bool SmiTreeNode< T >::hasChild | ( |  | ) | `[inline]`

Definition at line 36 of file SmiScenarioTree.hpp.

template<class T>

bool SmiTreeNode< T >::hasSibling | ( |  | ) | `[inline]`

Definition at line 39 of file SmiScenarioTree.hpp.

template<class T>

SmiTreeNode<T>* SmiTreeNode< T >::getParent | ( |  | ) | `[inline]`

Definition at line 43 of file SmiScenarioTree.hpp.

template<class T>

SmiTreeNode<T>* SmiTreeNode< T >::getChild | ( |  | ) | `[inline]`

Definition at line 46 of file SmiScenarioTree.hpp.

template<class T>

SmiTreeNode<T>* SmiTreeNode< T >::getSibling | ( |  | ) | `[inline]`

Definition at line 49 of file SmiScenarioTree.hpp.

template<class T>

void SmiTreeNode< T >::setLastChildLabel | ( | int | label | ) | `[inline]`

Definition at line 53 of file SmiScenarioTree.hpp.

template<class T>

SmiTreeNode<T>* SmiTreeNode< T >::getChildByLabel | ( | int | n | ) | `[inline]`

Definition at line 57 of file SmiScenarioTree.hpp.

template<class T>

int SmiTreeNode< T >::depth | ( |  | ) | `[inline]`

Definition at line 76 of file SmiScenarioTree.hpp.

template<class T>

int SmiTreeNode< T >::numChildren | ( |  | ) | `[inline]`

Definition at line 79 of file SmiScenarioTree.hpp.

template<class T>

int SmiTreeNode< T >::scenario | ( |  | ) | `[inline]`

Definition at line 82 of file SmiScenarioTree.hpp.

template<class T>

void SmiTreeNode< T >::setScenario | ( | int | s | ) | `[inline]`

Definition at line 85 of file SmiScenarioTree.hpp.

template<class T>

SmiTreeNode<T>* SmiTreeNode< T >::addChild | ( | T | cd,
|  | int | scenario |
| ) |  |  | `[inline]`

Definition at line 90 of file SmiScenarioTree.hpp.

template<class T>

std::vector<SmiTreeNode<T> *>* SmiTreeNode< T >::getChildren | ( |  | ) | `[inline]`

Definition at line 102 of file SmiScenarioTree.hpp.

template<class T>

T SmiTreeNode< T >::getDataPtr | ( |  | ) | `[inline]`

Definition at line 115 of file SmiScenarioTree.hpp.

template<class T>

void SmiTreeNode< T >::setChild | ( | SmiTreeNode< T > * | c | ) | `[inline, protected]`

Definition at line 154 of file SmiScenarioTree.hpp.

template<class T>

void SmiTreeNode< T >::setSibling | ( | SmiTreeNode< T > * | s | ) | `[inline, protected]`

Definition at line 157 of file SmiScenarioTree.hpp.

template<class T>

SmiTreeNode<T>* SmiTreeNode< T >::getParentP | ( |  | ) | `[inline, protected]`

Definition at line 160 of file SmiScenarioTree.hpp.

template<class T>

SmiTreeNode<T>* SmiTreeNode< T >::getChildP | ( |  | ) | `[inline, protected]`

Definition at line 163 of file SmiScenarioTree.hpp.

template<class T>

SmiTreeNode<T>* SmiTreeNode< T >::getSiblingP | ( |  | ) | `[inline, protected]`

Definition at line 166 of file SmiScenarioTree.hpp.

## Member Data Documentation

template<class T>

SmiTreeNode<T>* SmiTreeNode< T >::parent_`[private]`

Definition at line 171 of file SmiScenarioTree.hpp.

template<class T>

SmiTreeNode<T>* SmiTreeNode< T >::child_`[private]`

Definition at line 172 of file SmiScenarioTree.hpp.

template<class T>

SmiTreeNode<T>* SmiTreeNode< T >::sibling_`[private]`

Definition at line 173 of file SmiScenarioTree.hpp.

template<class T>

int SmiTreeNode< T >::scen_`[private]`

Definition at line 174 of file SmiScenarioTree.hpp.

template<class T>

int SmiTreeNode< T >::nchild_`[private]`

Definition at line 175 of file SmiScenarioTree.hpp.

template<class T>

int SmiTreeNode< T >::depth_`[private]`

Definition at line 176 of file SmiScenarioTree.hpp.

template<class T>

T SmiTreeNode< T >::ptr_`[private]`

Definition at line 177 of file SmiScenarioTree.hpp.

template<class T>

child_label_map SmiTreeNode< T >::child_labels_`[private]`

Definition at line 178 of file SmiScenarioTree.hpp.

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

- /home/coin/svn-release/Smi-0.93.1/Smi/src/SmiScenarioTree.hpp