copasi API  0.1
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes
CKeyFactory Class Reference

#include <CKeyFactory.h>

List of all members.

Classes

class  CDecisionVector
class  HashTable

Public Member Functions

 CKeyFactory ()
 ~CKeyFactory ()
std::string add (const std::string &prefix, CCopasiObject *pObject)
bool addFix (const std::string &key, CCopasiObject *pObject)
bool remove (const std::string &key)
CCopasiObjectget (const std::string &key)

Static Public Member Functions

static bool isValidKey (const std::string &key, const std::string &prefix="")

Protected Attributes

std::map< std::string, HashTable > mKeyTable

Static Protected Attributes

static CDecisionVector isDigit
static CDecisionVector isPrefix

Constructor & Destructor Documentation

CKeyFactory::CKeyFactory ( )

Default constructor

CKeyFactory::~CKeyFactory ( )

Destructor


Member Function Documentation

std::string CKeyFactory::add ( const std::string &  prefix,
CCopasiObject pObject 
)

Add an object with a key generated from the given prefix to the key map. The return value is the actually generated key.

Parameters:
conststd::string & prefix
CCopasiObject* pObject
Returns:
std::string key
bool CKeyFactory::addFix ( const std::string &  key,
CCopasiObject pObject 
)

Add an object with a fix given key. The return value indicate whether the key was actually inserted.

Parameters:
conststd::string & key
CCopasiObject* pObject
Returns:
bool success
CCopasiObject * CKeyFactory::get ( const std::string &  key)

Retreive the object referred by key from the key map.

Parameters:
conststd::string & key
Returns:
CCopasiObject * pObject
bool CKeyFactory::isValidKey ( const std::string &  key,
const std::string &  prefix = "" 
) [static]

check whether the key is valid

Parameters:
conststd::string & key
conststd::string & prefix (default: check for [_a-zA-Z]+_+)
Returns:
bool isValid

CKeyFactory class. This class is used to create a unique key whithin COPASI. It also allows retreival of the CCopasiObject the key is assigned to.

Created for Copasi by Stefan Hoops 2003 Copyright Stefan Hoops

bool CKeyFactory::remove ( const std::string &  key)

Remove the key and the related object from the key map.

Parameters:
conststd::string & key
Returns:
bool success

Member Data Documentation

CKeyFactory::CDecisionVector CKeyFactory::isDigit [static, protected]

Fast way to decide whether a character is a digit.

CKeyFactory::CDecisionVector CKeyFactory::isPrefix [static, protected]

Fast way to decide whether a character is a valid part of the prefix.

std::map< std::string, HashTable > CKeyFactory::mKeyTable [protected]

A map of hash tables for the prefixes.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines