LibCT 2.0
Public Member Functions | Protected Attributes

LibCT::VariableContainer Class Reference

VariableContainer is a class to hold an access user-defnied variables. More...

#include <VariableContainer.h>

Inheritance diagram for LibCT::VariableContainer:
LibCT::ConversationNode LibCT::GlobalVars

List of all members.

Public Member Functions

 VariableContainer ()
 Constructor.
 ~VariableContainer ()
 Destructor.
void SetValue (const std::string &name, int value)
 Set a variable (creates if it doesn't exist)
void SetValue (const std::string &name, float value)
 Set a variable (creates if it doesn't exist)
void SetValue (const std::string &name, double value)
 Set a variable (creates if it doesn't exist)
void SetValue (const std::string &name, bool value)
 Set a variable (creates if it doesn't exist)
void SetValue (const std::string &name, const std::string &value)
 Set a variable (creates if it doesn't exist)
bool GetValue (const std::string &name, int &value) const
bool GetValue (const std::string &name, float &value) const
bool GetValue (const std::string &name, double &value) const
bool GetValue (const std::string &name, bool &value) const
bool GetValue (const std::string &name, std::string &value) const
const VariableListGetVariableList () const
void RemoveVariable (const std::string &name)
 Remove a variable.
VariableInterfaceGetVariable (const std::string &name) const

Protected Attributes

VariableList m_Variables
 List of all variables.

Detailed Description

VariableContainer is a class to hold an access user-defnied variables.


Constructor & Destructor Documentation

LibCT::VariableContainer::VariableContainer ( )

Constructor.

LibCT::VariableContainer::~VariableContainer ( )

Destructor.


Member Function Documentation

bool LibCT::VariableContainer::GetValue ( const std::string &  name,
int &  value 
) const

Get the value of a variable

Returns:
True if variable found and of correct type, False otherwise
Parameters:
nameName of the variable
valueValue to set
bool LibCT::VariableContainer::GetValue ( const std::string &  name,
double &  value 
) const

Get the value of a variable

Returns:
True if variable found and of correct type, False otherwise
Parameters:
nameName of the variable
valueValue to set
bool LibCT::VariableContainer::GetValue ( const std::string &  name,
bool &  value 
) const

Get the value of a variable

Returns:
True if variable found and of correct type, False otherwise
Parameters:
nameName of the variable
valueValue to set
bool LibCT::VariableContainer::GetValue ( const std::string &  name,
std::string &  value 
) const

Get the value of a variable

Returns:
True if variable found and of correct type, False otherwise
Parameters:
nameName of the variable
valueValue to set
bool LibCT::VariableContainer::GetValue ( const std::string &  name,
float &  value 
) const

Get the value of a variable

Returns:
True if variable found and of correct type, False otherwise
Parameters:
nameName of the variable
valueValue to set
VariableInterface* LibCT::VariableContainer::GetVariable ( const std::string &  name) const

Get a variable with a given name

Returns:
The variable matching name, or null if not found
const VariableList* LibCT::VariableContainer::GetVariableList ( ) const

Get the list of variables

Returns:
The list of variables
void LibCT::VariableContainer::RemoveVariable ( const std::string &  name)

Remove a variable.

Parameters:
nameName of the variable to remove
void LibCT::VariableContainer::SetValue ( const std::string &  name,
const std::string &  value 
)

Set a variable (creates if it doesn't exist)

Parameters:
nameName of the variable
valueValue to set
void LibCT::VariableContainer::SetValue ( const std::string &  name,
double  value 
)

Set a variable (creates if it doesn't exist)

Parameters:
nameName of the variable
valueValue to set
void LibCT::VariableContainer::SetValue ( const std::string &  name,
bool  value 
)

Set a variable (creates if it doesn't exist)

Parameters:
nameName of the variable
valueValue to set
void LibCT::VariableContainer::SetValue ( const std::string &  name,
float  value 
)

Set a variable (creates if it doesn't exist)

Parameters:
nameName of the variable
valueValue to set
void LibCT::VariableContainer::SetValue ( const std::string &  name,
int  value 
)

Set a variable (creates if it doesn't exist)

Parameters:
nameName of the variable
valueValue to set

Member Data Documentation

List of all variables.


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