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

Public Member Functions

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

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

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
StateTemplate 
StateTemplateVariable 

Definition at line 590 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 5120 of file CCopasiXMLParser.cpp.

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 5167 of file CCopasiXMLParser.cpp.

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

5168 {
5169  switch (mCurrentElement)
5170  {
5171  case StateTemplate:
5172 
5173  if (strcmp(pszName, "StateTemplate"))
5175  pszName, "StateTemplate", mParser.getCurrentLineNumber());
5176 
5179 
5180  /* Tell the parent element we are done. */
5181  mParser.onEndElement(pszName);
5182  break;
5183 
5184  case StateTemplateVariable:
5185 
5186  if (strcmp(pszName, "StateTemplateVariable"))
5188  pszName, "StateTemplateVariable", mParser.getCurrentLineNumber());
5189 
5191  break;
5192 
5193  case UNKNOWN_ELEMENT:
5194  mCurrentElement = mLastKnownElement;
5195  break;
5196 
5197  default:
5199  pszName, "???", mParser.getCurrentLineNumber());
5200  break;
5201  }
5202 
5203  return;
5204 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::StateTemplateElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 5125 of file CCopasiXMLParser.cpp.

References CCopasiMessage::EXCEPTION, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::StateVariableList, and UNKNOWN_ELEMENT.

5127 {
5128  mCurrentElement++; /* We should always be on the next element */
5129 
5130  switch (mCurrentElement)
5131  {
5132  case StateTemplate:
5133 
5134  if (strcmp(pszName, "StateTemplate"))
5136  pszName, "StateTemplate", mParser.getCurrentLineNumber());
5137 
5138  mCommon.StateVariableList.clear();
5139  break;
5140 
5141  case StateTemplateVariable:
5142 
5143  if (strcmp(pszName, "StateTemplateVariable"))
5145  pszName, "StateTemplateVariable", mParser.getCurrentLineNumber());
5146 
5147  /* If we do not have a StateTemplateVariable element handler we create one. */
5148  if (!mpCurrentHandler)
5149  mpCurrentHandler = new StateTemplateVariableElement(mParser, mCommon);
5150 
5151  /* Push the StateTemplateVariable element handler on the stack and call it. */
5153  mpCurrentHandler->start(pszName, papszAttrs);
5154  break;
5155 
5156  default:
5160  mParser.onStartElement(pszName, papszAttrs);
5161  break;
5162  }
5163 
5164  return;
5165 }
UnknownElement mUnknownElement
std::vector< CModelEntity * > StateVariableList
#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
int getCurrentLineNumber() const
Definition: CExpat.h:470

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