template class CBNSState : public CBNSStateBase

This templatized class holds the information regarding the state of a given node

Inheritance:


Public Fields

static int m_nCounter
This variable is used to check for memory leaks in the program.

Public

Constructors and Destructor
CBNSState ()
Default constructor
CBNSState (CBNSState& cState)
Copy Constructor
CBNSState (string strName)
Constructor with the name of the state
CBNSState (string strName, int nNum, T* ptItems)
Constructor with the name and discrete possibilities of this state
CBNSState (int nNum, T* ptItems)
Constructor with discrete possibilities for the state
~CBNSState ()
Destructor
Out Functions
virtual double GetProbability ()
Returns the probability of the state
virtual string GetName ()
Returns the name of the state
int GetNumRanges ()
Returns the number of ranges for this state
bool GetRange (int nRange, T& tMin, T& tMax)
Returns the minimum and maximum of the nRange in in tMin and tMax
bool GetRange (int nRange, T& tMin)
Returns the minimum value of the nRange in tMin
vector <CBNSRange > * GetRanges ()
Retuns the vector of ranges for this state
Out Functions
virtual void SetProbability (double dValue)
Sets the probability of the state to dValue
virtual void SetName (string strName)
Sets the name of the state to strName
void Add (T tMin, T tMax)
Adds a range to the state
void AddRange (T tMin, T tMax)
Adds a range to the state
void Add (T tValue)
Adds a range to the state
void AddRangeWithLabel (T tMin, T tMax, string strLabel)
Adds a range with a label to the state
void AddWithLabel (T tValue, string strLabel)
Adds a range with a label to the state
void AddSet (int nNum, T* ptItems)
Adds a set of ranges to the state
void RemoveSet (int nNum, T* ptItems)
Removes a set of ranges from the state
void Remove (T tItem)
Removes a range with minimum value given by tItem
void Remove (T tMin, T tMax)
Removes a range with minimum and maximum value
Test Functions
bool IsIn (T tTest, string* pstrLabel = NULL)
Returns true if the value tTest falls in the given set of ranges
string IsInWhat (T tTest)
Returns the label of the range whose minimum value is given by tTest
Overloaded Operators
operator string () const
Returns the name of the string
void operator= (const CBNSState& cState)
Assignment operator
bool operator== (T tTest)
Equal to operator
bool operator!= (T tTest)
Not Equal to operator

Private

Private Member Variables
vector <CBNSRange > m_vRanges
vector of Ranges for the state
T m_tValue
Value of the state

Inherited from CBNSStateBase:

Public Methods

virtual double GetProbability()
virtual string GetName()
virtual void SetProbability(double dValue)
virtual void SetName(string strName)

Protected Fields

string m_strName
double m_dProbability

Documentation

This templatized class holds the information regarding the state of a given node. The class is templatized because the state could belong to any category.
Private Member Variables

vector <CBNSRange > m_vRanges
vector of Ranges for the state

T m_tValue
Value of the state

static int m_nCounter
This variable is used to check for memory leaks in the program.

Constructors and Destructor

CBNSState()
Default constructor

CBNSState(CBNSState& cState)
Copy Constructor
Parameters:
cState - a clone of this state is made

CBNSState(string strName)
Constructor with the name of the state
Parameters:
strName - name of the state

CBNSState(string strName, int nNum, T* ptItems)
Constructor with the name and discrete possibilities of this state
Parameters:
strName - the name of the state
nNum - the number of discrete possibilities for this state
ptItems - pointer to the array of possibilities

CBNSState(int nNum, T* ptItems)
Constructor with discrete possibilities for the state
Parameters:
nNum - the number of discrete possibilities for this state
ptItems - pointer to the array of possibilities

~CBNSState()
Destructor

Out Functions

virtual double GetProbability()
Returns the probability of the state
Returns:
double

virtual string GetName()
Returns the name of the state
Returns:
string

int GetNumRanges()
Returns the number of ranges for this state
Returns:
int

bool GetRange(int nRange, T& tMin, T& tMax)
Returns the minimum and maximum of the nRange in in tMin and tMax. The function returns false if nRange is greater than the number of ranges
Returns:
bool
Parameters:
nRange - the range for which the min and max is sought
tMin - a reference to min value
tMax - a reference to max value

bool GetRange(int nRange, T& tMin)
Returns the minimum value of the nRange in tMin. The function returns false if nRange exceeds the number of ranges
Parameters:
nRange - the range for which the min and max is sought
tMin - a reference to min value

vector <CBNSRange > * GetRanges()
Retuns the vector of ranges for this state
Returns:
vector >

Out Functions

virtual void SetProbability(double dValue)
Sets the probability of the state to dValue
Parameters:
dValue - the probability is set to this value

virtual void SetName(string strName)
Sets the name of the state to strName
Parameters:
strName - the name of the state is set to this string

void Add(T tMin, T tMax)
Adds a range to the state
Parameters:
tMin - the minimum value of the range
tMax - the maximum value of the range

void AddRange(T tMin, T tMax)
Adds a range to the state
Parameters:
tMin - the minimum value of the range
tMax - the maximum value of the range

void Add(T tValue)
Adds a range to the state
Parameters:
tValue - the minimum value of the range

void AddRangeWithLabel(T tMin, T tMax, string strLabel)
Adds a range with a label to the state
Parameters:
tMin - the minimum value of the range
tMax - the maximum value of the range
strLabel - the label of the range

void AddWithLabel(T tValue, string strLabel)
Adds a range with a label to the state
Parameters:
tValue - the minimum value of the range
strLabel - the label of the range

void AddSet(int nNum, T* ptItems)
Adds a set of ranges to the state
Parameters:
nNum - the number of ranges
ptItems - a pointer to the array of ranges

void RemoveSet(int nNum, T* ptItems)
Removes a set of ranges from the state
Parameters:
nNum - the number of ranges
ptItems - a pointer to the array of ranges

void Remove(T tItem)
Removes a range with minimum value given by tItem
Parameters:
tItem - the minimum value of the range

void Remove(T tMin, T tMax)
Removes a range with minimum and maximum value
Parameters:
tMin - the minimum value of the range
tMax - the maximum value of the range

Test Functions

bool IsIn(T tTest, string* pstrLabel = NULL)
Returns true if the value tTest falls in the given set of ranges. The function returns "Not In" in pstrLabel if tTest is not found
Parameters:
tTest - the value to be tested
pstrLabel - the label of the range in which tTest falls

string IsInWhat(T tTest)
Returns the label of the range whose minimum value is given by tTest
Returns:
string
Parameters:
tTest - the minimum value of the range

Overloaded Operators

operator string() const
Returns the name of the string

void operator=(const CBNSState& cState)
Assignment operator

bool operator==(T tTest)
Equal to operator

bool operator!=(T tTest)
Not Equal to operator


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de