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

Public Member Functions

 ConstantElement (CCopasiXMLParser &parser, SCopasiXMLParserCommon &common)
 
virtual void end (const XML_Char *pszName)
 
virtual void start (const XML_Char *pszName, const XML_Char **papszAttrs)
 
virtual ~ConstantElement ()
 
- 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 { Constant = 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 791 of file CCopasiXMLParser.h.

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
Constant 

Definition at line 799 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 4625 of file CCopasiXMLParser.cpp.

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 4672 of file CCopasiXMLParser.cpp.

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

4673 {
4674  switch (mCurrentElement)
4675  {
4676  case Constant:
4677 
4678  if (strcmp(pszName, "Constant"))
4680  pszName, "Constant", mParser.getCurrentLineNumber());
4681 
4684 
4685  /* Tell the parent element we are done. */
4686  mParser.onEndElement(pszName);
4687  break;
4688 
4689  case UNKNOWN_ELEMENT:
4691  break;
4692 
4693  default:
4695  pszName, "???", mParser.getCurrentLineNumber());
4696  break;
4697  }
4698 
4699  return;
4700 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ConstantElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 4630 of file CCopasiXMLParser.cpp.

References C_FLOAT64, CCopasiParameter::DOUBLE, CCopasiMessage::EXCEPTION, CCopasiParameterGroup::getParameter(), CReaction::getParameters(), CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pReaction, and UNKNOWN_ELEMENT.

4632 {
4633  const char * Key;
4634  const char * Name;
4635  const char * Value;
4636 
4637  mCurrentElement++; /* We should always be on the next element */
4638 
4639  switch (mCurrentElement)
4640  {
4641  case Constant:
4642 
4643  if (strcmp(pszName, "Constant"))
4645  pszName, "Constant", mParser.getCurrentLineNumber());
4646 
4647  Key = mParser.getAttributeValue("key", papszAttrs);
4648  Name = mParser.getAttributeValue("name", papszAttrs);
4649  Value = mParser.getAttributeValue("value", papszAttrs);
4650 
4651  mCommon.pReaction->
4652  getParameters().addParameter(Name,
4655 
4656  addFix(Key,
4658 
4659  break;
4660 
4661  default:
4665  mParser.onStartElement(pszName, papszAttrs);
4666  break;
4667  }
4668 
4669  return;
4670 }
UnknownElement mUnknownElement
const char * getAttributeValue(const std::string &name, const char **attributes, const bool &required=true) const
Definition: CExpat.h:685
#define MCXML
void addFix(const std::string &key, CCopasiObject *pObject)
Definition: CXMLHandler.h:119
#define UNKNOWN_ELEMENT
virtual void onStartElement(const XML_Char *pszName, const XML_Char **papszAttrs)
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
CCopasiParameter * getParameter(const std::string &name)
#define C_FLOAT64
Definition: copasi.h:92
const CCopasiParameterGroup & getParameters() const
Definition: CReaction.cpp:333
int getCurrentLineNumber() const
Definition: CExpat.h:470

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