GEOS  3.8.0dev
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)
 
Table * GetTable ()
 

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 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

References IsNameCorrect().

Referenced by Add(), and EditName().

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

References Add(), ttmath::Misc::AssignString(), and IsNameCorrect().

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

Referenced by IsNameCorrect().

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

this method deletes an object

References IsNameCorrect().

Referenced by Delete().

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

this method deletes an object

References ttmath::Misc::AssignString(), Delete(), and IsNameCorrect().

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

this method changes the name of a specific object

References Add(), and IsNameCorrect().

Referenced by EditName().

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

this method changes the name of a specific object

References ttmath::Misc::AssignString(), EditName(), and IsNameCorrect().

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

References IsNameCorrect().

Referenced by EditValue().

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

References ttmath::Misc::AssignString(), EditValue(), and IsNameCorrect().

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

References IsNameCorrect().

Referenced by GetValue(), and ttmath::Parser< ValueType >::GetValueOfUserDefinedVariable().

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

this method gets the value of a specific object

References ttmath::Misc::AssignString(), GetValue(), and IsNameCorrect().

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)

References IsNameCorrect().

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)

References ttmath::Misc::AssignString(), GetValue(), and IsNameCorrect().

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

References IsNameCorrect().

Referenced by GetValueAndParam().

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

References ttmath::Misc::AssignString(), GetValueAndParam(), and IsNameCorrect().

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)

References IsNameCorrect().

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())

References ttmath::Misc::AssignString(), GetValueAndParam(), and IsNameCorrect().

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

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

Referenced by IsDefined().

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

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

References ttmath::Misc::AssignString(), IsDefined(), and IsNameCorrect().

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

References CorrectCharacter().

Referenced by Add(), Delete(), EditName(), EditValue(), GetValue(), GetValueAndParam(), and IsDefined().


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