All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
ttmath::Objects Class Reference

#include <ttmathobjects.h>

Classes

struct  Item
 

Public Types

typedef std::map< std::string,
Item
Table
 
typedef Table::iterator Iterator
 
typedef Table::const_iterator CIterator
 

Public Member Functions

bool IsDefined (const std::string &name)
 
bool IsDefined (const std::wstring &name)
 
ErrorCode Add (const std::string &name, const std::string &value, int param=0)
 
ErrorCode Add (const std::wstring &name, const std::wstring &value, int param=0)
 
bool Empty () const
 
void Clear ()
 
CIterator Begin () const
 
CIterator End () const
 
ErrorCode EditValue (const std::string &name, const std::string &value, int param=0)
 
ErrorCode EditValue (const std::wstring &name, const std::wstring &value, int param=0)
 
ErrorCode EditName (const std::string &old_name, const std::string &new_name)
 
ErrorCode EditName (const std::wstring &old_name, const std::wstring &new_name)
 
ErrorCode Delete (const std::string &name)
 
ErrorCode Delete (const std::wstring &name)
 
ErrorCode GetValue (const std::string &name, std::string &value) const
 
ErrorCode GetValue (const std::wstring &name, std::wstring &value)
 
ErrorCode GetValue (const std::string &name, const char **value) const
 
ErrorCode GetValue (const std::wstring &name, const char **value)
 
ErrorCode GetValueAndParam (const std::string &name, std::string &value, int *param) const
 
ErrorCode GetValueAndParam (const std::wstring &name, std::wstring &value, int *param)
 
ErrorCode GetValueAndParam (const std::string &name, const char **value, int *param) const
 
ErrorCode GetValueAndParam (const std::wstring &name, const char **value, int *param)
 
TableGetTable ()
 

Static Public Member Functions

static bool CorrectCharacter (int c, bool can_be_digit)
 
template<class string_type >
static bool IsNameCorrect (const string_type &name)
 

Detailed Description

objects of this class are used with the mathematical parser they hold variables or functions defined by a user

each object has its own table in which we're keeping variables or functions

Member Typedef Documentation

typedef Table::const_iterator ttmath::Objects::CIterator
typedef Table::iterator ttmath::Objects::Iterator
typedef std::map<std::string, Item> ttmath::Objects::Table

Member Function Documentation

ErrorCode ttmath::Objects::Add ( const std::string &  name,
const std::string &  value,
int  param = 0 
)
inline

this method adds one object (variable of function) into the table

ErrorCode ttmath::Objects::Add ( const std::wstring &  name,
const std::wstring &  value,
int  param = 0 
)
inline

this method adds one object (variable of function) into the table

CIterator ttmath::Objects::Begin ( ) const
inline

this method returns 'const_iterator' on the first item on the table

void ttmath::Objects::Clear ( )
inline

this method clears the table

static bool ttmath::Objects::CorrectCharacter ( int  c,
bool  can_be_digit 
)
inlinestatic

this method returns true if a character 'c' is a character which can be in a name

if 'can_be_digit' is true that means when the 'c' is a digit this method returns true otherwise it returns false

ErrorCode ttmath::Objects::Delete ( const std::string &  name)
inline

this method deletes an object

ErrorCode ttmath::Objects::Delete ( const std::wstring &  name)
inline

this method deletes an object

ErrorCode ttmath::Objects::EditName ( const std::string &  old_name,
const std::string &  new_name 
)
inline

this method changes the name of a specific object

ErrorCode ttmath::Objects::EditName ( const std::wstring &  old_name,
const std::wstring &  new_name 
)
inline

this method changes the name of a specific object

ErrorCode ttmath::Objects::EditValue ( const std::string &  name,
const std::string &  value,
int  param = 0 
)
inline

this method changes the value and the number of parameters for a specific object

ErrorCode ttmath::Objects::EditValue ( const std::wstring &  name,
const std::wstring &  value,
int  param = 0 
)
inline

this method changes the value and the number of parameters for a specific object

bool ttmath::Objects::Empty ( ) const
inline

this method returns 'true' if the table is empty

CIterator ttmath::Objects::End ( ) const
inline

this method returns 'const_iterator' pointing at the space after last item (returns table.end())

Table* ttmath::Objects::GetTable ( )
inline

this method returns a pointer into the table

ErrorCode ttmath::Objects::GetValue ( const std::string &  name,
std::string &  value 
) const
inline

this method gets the value of a specific object

ErrorCode ttmath::Objects::GetValue ( const std::wstring &  name,
std::wstring &  value 
)
inline

this method gets the value of a specific object

ErrorCode ttmath::Objects::GetValue ( const std::string &  name,
const char **  value 
) const
inline

this method gets the value of a specific object (this version is used for not copying the whole string)

ErrorCode ttmath::Objects::GetValue ( const std::wstring &  name,
const char **  value 
)
inline

this method gets the value of a specific object (this version is used for not copying the whole string)

ErrorCode ttmath::Objects::GetValueAndParam ( const std::string &  name,
std::string &  value,
int *  param 
) const
inline

this method gets the value and the number of parameters of a specific object

ErrorCode ttmath::Objects::GetValueAndParam ( const std::wstring &  name,
std::wstring &  value,
int *  param 
)
inline

this method gets the value and the number of parameters of a specific object

ErrorCode ttmath::Objects::GetValueAndParam ( const std::string &  name,
const char **  value,
int *  param 
) const
inline

this method sets the value and the number of parameters of a specific object (this version is used for not copying the whole string)

ErrorCode ttmath::Objects::GetValueAndParam ( const std::wstring &  name,
const char **  value,
int *  param 
)
inline

this method sets the value and the number of parameters of a specific object (this version is used for not copying the whole string but in fact we make one copying during AssignString())

bool ttmath::Objects::IsDefined ( const std::string &  name)
inline

this method returns true if such an object is defined (name exists)

bool ttmath::Objects::IsDefined ( const std::wstring &  name)
inline

this method returns true if such an object is defined (name exists)

template<class string_type >
static bool ttmath::Objects::IsNameCorrect ( const string_type &  name)
inlinestatic

this method returns true if the name can be as a name of an object


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