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

Public Member Functions

virtual void end (const XML_Char *pszName)
 
 ListOfReactionsElement (CCopasiXMLParser &parser, SCopasiXMLParserCommon &common)
 
virtual void start (const XML_Char *pszName, const XML_Char **papszAttrs)
 
virtual ~ListOfReactionsElement ()
 
- 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 { ListOfReactions = 0, Reaction }
 

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 1202 of file CCopasiXMLParser.h.

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
ListOfReactions 
Reaction 

Definition at line 1210 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 3639 of file CCopasiXMLParser.cpp.

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 3686 of file CCopasiXMLParser.cpp.

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

3687 {
3688  switch (mCurrentElement)
3689  {
3690  case ListOfReactions:
3691 
3692  if (strcmp(pszName, "ListOfReactions"))
3694  pszName, "ListOfReactions", mParser.getCurrentLineNumber());
3695 
3698 
3699  /* Tell the parent element we are done. */
3700  mParser.onEndElement(pszName);
3701  break;
3702 
3703  case Reaction:
3704 
3705  if (strcmp(pszName, "Reaction"))
3707  pszName, "Reaction", mParser.getCurrentLineNumber());
3708 
3710  break;
3711 
3712  case UNKNOWN_ELEMENT:
3713  mCurrentElement = mLastKnownElement;
3714  break;
3715 
3716  default:
3718  pszName, "???", mParser.getCurrentLineNumber());
3719  break;
3720  }
3721 
3722  return;
3723 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ListOfReactionsElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 3644 of file CCopasiXMLParser.cpp.

References CCopasiVector< T >::clear(), CCopasiMessage::EXCEPTION, CModel::getReactions(), CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pModel, and UNKNOWN_ELEMENT.

3646 {
3647  mCurrentElement++; /* We should always be on the next element */
3648 
3649  switch (mCurrentElement)
3650  {
3651  case ListOfReactions:
3652 
3653  if (strcmp(pszName, "ListOfReactions"))
3655  pszName, "ListOfReactions", mParser.getCurrentLineNumber());
3656 
3658  break;
3659 
3660  case Reaction:
3661 
3662  if (strcmp(pszName, "Reaction"))
3664  pszName, "Reaction", mParser.getCurrentLineNumber());
3665 
3666  /* If we do not have a Reaction element handler we create one. */
3667  if (!mpCurrentHandler)
3668  mpCurrentHandler = new ReactionElement(mParser, mCommon);
3669 
3670  /* Push the Reaction element handler on the stack and call it. */
3672  mpCurrentHandler->start(pszName, papszAttrs);
3673  break;
3674 
3675  default:
3679  mParser.onStartElement(pszName, papszAttrs);
3680  break;
3681  }
3682 
3683  return;
3684 }
UnknownElement mUnknownElement
#define MCXML
#define UNKNOWN_ELEMENT
virtual void onStartElement(const XML_Char *pszName, const XML_Char **papszAttrs)
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
virtual void start(const XML_Char *C_UNUSED(pszName), const XML_Char **C_UNUSED(papszAttrs))
Definition: CXMLHandler.h:87
CCopasiVectorNS< CReaction > & getReactions()
Definition: CModel.cpp:1039
virtual void clear()
int getCurrentLineNumber() const
Definition: CExpat.h:470

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