COPASI API  4.16.103
Public Member Functions | Private Types | List of all members
CCopasiXMLParser::SBMLMapElement Class Reference
Inheritance diagram for CCopasiXMLParser::SBMLMapElement:
Inheritance graph
[legend]
Collaboration diagram for CCopasiXMLParser::SBMLMapElement:
Collaboration graph
[legend]

Public Member Functions

virtual void end (const XML_Char *pszName)
 
 SBMLMapElement (CCopasiXMLParser &parser, SCopasiXMLParserCommon &common)
 
virtual void start (const XML_Char *pszName, const XML_Char **papszAttrs)
 
virtual ~SBMLMapElement ()
 
- Public Member Functions inherited from CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon >
 CXMLElementHandler (CCopasiXMLParser &parser, SCopasiXMLParserCommon &common)
 
virtual void end (const XML_Char *C_UNUSED(pszName))
 
virtual void reset ()
 
virtual void start (const XML_Char *C_UNUSED(pszName), const XML_Char **C_UNUSED(papszAttrs))
 
virtual ~CXMLElementHandler ()
 

Private Types

enum  Element { SBMLMap = 0 }
 

Additional Inherited Members

- Protected Member Functions inherited from CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon >
void addFix (const std::string &key, CCopasiObject *pObject)
 
void deleteCurrentHandler ()
 
- Protected Attributes inherited from CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon >
SCopasiXMLParserCommonmCommon
 
C_INT32 mCurrentElement
 
C_INT32 mLastKnownElement
 
CCopasiXMLParsermParser
 
CXMLElementHandlermpCurrentHandler
 

Detailed Description

Definition at line 3708 of file CCopasiXMLParser.h.

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
SBMLMap 

Definition at line 3716 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

CCopasiXMLParser::SBMLMapElement::SBMLMapElement ( CCopasiXMLParser parser,
SCopasiXMLParserCommon common 
)
CCopasiXMLParser::SBMLMapElement::~SBMLMapElement ( )
virtual

Destructor

Definition at line 10889 of file CCopasiXMLParser.cpp.

Member Function Documentation

void CCopasiXMLParser::SBMLMapElement::end ( const XML_Char *  pszName)
virtual

End element handler

Parameters
constXML_Char *pszName

Definition at line 10947 of file CCopasiXMLParser.cpp.

References CCopasiMessage::EXCEPTION, MCXML, CExpatTemplate< CExpat >::mParser, START_ELEMENT, and UNKNOWN_ELEMENT.

10948 {
10949  switch (mCurrentElement)
10950  {
10951  case SBMLMap:
10952 
10953  if (strcmp(pszName, "SBMLMap"))
10955  pszName, "SBMLMap", mParser.getCurrentLineNumber());
10956 
10959 
10960  /* Tell the parent element we are done. */
10961  mParser.onEndElement(pszName);
10962  break;
10963 
10964  case UNKNOWN_ELEMENT:
10966  break;
10967 
10968  default:
10970  pszName, "???", mParser.getCurrentLineNumber());
10971  break;
10972  }
10973 
10974  return;
10975 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::SBMLMapElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 10894 of file CCopasiXMLParser.cpp.

References CCopasiMessage::EXCEPTION, CKeyFactory::get(), SCopasiXMLParserCommon::KeyMap, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, CFunction::setSBMLId(), CModelEntity::setSBMLId(), CReaction::setSBMLId(), and UNKNOWN_ELEMENT.

10896 {
10897  const char * SBMLid;
10898  const char * COPASIkey;
10899  CCopasiObject * pObject;
10900 
10901  mCurrentElement++; /* We should always be on the next element */
10902 
10903  switch (mCurrentElement)
10904  {
10905  case SBMLMap:
10906 
10907  if (strcmp(pszName, "SBMLMap"))
10909  pszName, "SBMLMap", mParser.getCurrentLineNumber());
10910 
10911  SBMLid = mParser.getAttributeValue("SBMLid", papszAttrs);
10912  COPASIkey = mParser.getAttributeValue("COPASIkey", papszAttrs);
10913 
10914  if ((pObject = mCommon.KeyMap.get(COPASIkey)))
10915  {
10916  CFunction * pFunction;
10917  CCompartment* pCompartment;
10918  CMetab * pMetab;
10919  CModelValue * pModelValue;
10920  CReaction * pReaction;
10921 
10922  if ((pFunction = dynamic_cast<CFunction *>(pObject)))
10923  pFunction->setSBMLId(SBMLid);
10924  else if ((pCompartment = dynamic_cast<CCompartment *>(pObject)))
10925  pCompartment->setSBMLId(SBMLid);
10926  else if ((pMetab = dynamic_cast<CMetab *>(pObject)))
10927  pMetab->setSBMLId(SBMLid);
10928  else if ((pModelValue = dynamic_cast<CModelValue *>(pObject)))
10929  pModelValue->setSBMLId(SBMLid);
10930  else if ((pReaction = dynamic_cast<CReaction *>(pObject)))
10931  pReaction->setSBMLId(SBMLid);
10932  }
10933 
10934  break;
10935 
10936  default:
10940  mParser.onStartElement(pszName, papszAttrs);
10941  break;
10942  }
10943 
10944  return;
10945 }
UnknownElement mUnknownElement
CCopasiObject * get(const std::string &key)
const char * getAttributeValue(const std::string &name, const char **attributes, const bool &required=true) const
Definition: CExpat.h:685
#define MCXML
Definition: CMetab.h:178
#define UNKNOWN_ELEMENT
virtual void onStartElement(const XML_Char *pszName, const XML_Char **papszAttrs)
void setSBMLId(const std::string &id)
Definition: CFunction.cpp:63
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
void setSBMLId(const std::string &id)
Definition: CReaction.cpp:1649
The class for handling a chemical kinetic function.
Definition: CFunction.h:29
int getCurrentLineNumber() const
Definition: CExpat.h:470
void setSBMLId(const std::string &id)

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