COPASI API  4.40.278
CRegisteredCommonName Class Reference

#include <CRegisteredCommonName.h>

Inheritance diagram for CRegisteredCommonName:


class  ClassMemberRename
class  Rename
class  RenameInterface

Public Member Functions

 CRegisteredCommonName ()
 CRegisteredCommonName (const CRegisteredCommonName &src)
 CRegisteredCommonName (const std::string &name)
 ~CRegisteredCommonName ()
- Public Member Functions inherited from CCommonName
 CCommonName ()
 CCommonName (const CCommonName &src)
 CCommonName (const char *name)
 CCommonName (const std::string &name)
std::string::size_type findNext (const std::string &toFind, const std::string::size_type &pos=0) const
std::string::size_type findPrevious (const std::string &toFind, const std::string::size_type &pos=std::string::npos) const
size_t getElementIndex (const size_t &pos=0) const
std::string getElementName (const size_t &pos, const bool &unescape=true) const
std::string getObjectName () const
std::string getObjectType () const
CCommonName getPrimary () const
CCommonName getRemainder () const
void split (CCommonName &parentCN, std::string &objectType, std::string &objectName) const
 ~CCommonName ()

Static Public Member Functions

static void deregisterHandler (RenameInterface *pRenameHandler)
static void handle (const std::string &oldCN, const std::string &newCN)
static const bool & isEnabled ()
static void registerHandler (RenameInterface *pRenameHandler)
static void sanitizeObjectNames ()
static void setEnabled (const bool &enabled)
- Static Public Member Functions inherited from CCommonName
static std::string compartmentNameFromCN (const CCommonName &cn)
static std::string construct (const CCommonName &parent, const std::string &objectType, const std::string &objectName)
static std::string escape (const std::string &name)
static std::string fromData (const CData &data)
static std::string nameFromCN (const CCommonName &cn)
static std::string unescape (const std::string &name)

Static Private Attributes

static bool mEnabled
static std::set< RenameInterface * > mRegisteredHandlers
static std::set< CRegisteredCommonName * > mSet

Constructor & Destructor Documentation

◆ CRegisteredCommonName() [1/3]

CRegisteredCommonName::CRegisteredCommonName ( )

Default Constructor

References mSet.

◆ CRegisteredCommonName() [2/3]

CRegisteredCommonName::CRegisteredCommonName ( const CRegisteredCommonName src)

Copy Constructor

constCRegisteredCommonName & src

References mSet.

◆ ~CRegisteredCommonName()

CRegisteredCommonName::~CRegisteredCommonName ( )


References mSet.

◆ CRegisteredCommonName() [3/3]

CRegisteredCommonName::CRegisteredCommonName ( const std::string &  name)

Constructor from base class

conststd::string & name

References mSet.

Member Function Documentation

◆ deregisterHandler()

void CRegisteredCommonName::deregisterHandler ( CRegisteredCommonName::RenameInterface pRenameHandler)

Deregister and additional handler

RenameInterface* pRenameHandler

References mRegisteredHandlers.

◆ handle()

void CRegisteredCommonName::handle ( const std::string &  oldCN,
const std::string &  newCN 

Update all registered common names which contain the oldCN

conststd::string & oldCN
conststd::string & newCN

References mEnabled, mRegisteredHandlers, and mSet.

Referenced by CCompartment::addMetabolite(), CModelExpansion::replaceInMetab(), CMetab::setCompartment(), CDataObject::setObjectName(), and CDataObject::setObjectParent().

◆ isEnabled()

const bool & CRegisteredCommonName::isEnabled ( )

Check whether the rename handler is enabled

const bool & enabled

References mEnabled.

Referenced by CDataObject::CDataObject(), CModel::compile(), CModelExpansion::replaceInMetab(), CMetab::setCompartment(), CDataObject::setObjectName(), and CDataObject::setObjectParent().

◆ registerHandler()

void CRegisteredCommonName::registerHandler ( CRegisteredCommonName::RenameInterface pRenameHandler)

Register and additional handler

RenameInterface* pRenameHandler

References mRegisteredHandlers.

◆ sanitizeObjectNames()

void CRegisteredCommonName::sanitizeObjectNames ( )

Old files (before build 171) may have common name where invalid characters have been used. This function sanitizes the name part

References CCommonName::escape(), CCommonName::findNext(), CCommonName::getElementName(), CCommonName::getObjectName(), CCommonName::getObjectType(), CCommonName::getRemainder(), mSet, and CDataObject::sanitizeObjectName().

Referenced by CCopasiXML::fixBuild171().

◆ setEnabled()

Member Data Documentation

◆ mEnabled

bool CRegisteredCommonName::mEnabled

A flag indicating whether renaming is enabled.

Referenced by handle(), isEnabled(), and setEnabled().

◆ mRegisteredHandlers

std::set< CRegisteredCommonName::RenameInterface * > CRegisteredCommonName::mRegisteredHandlers

A set of registered handlers

Referenced by deregisterHandler(), handle(), and registerHandler().

◆ mSet

std::set< CRegisteredCommonName * > CRegisteredCommonName::mSet

A set which contains all registered comon names

Referenced by CRegisteredCommonName(), handle(), sanitizeObjectNames(), and ~CRegisteredCommonName().

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