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

Public Member Functions

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

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
StateTemplateVariable 

Definition at line 549 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 5211 of file CCopasiXMLParser.cpp.

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 5254 of file CCopasiXMLParser.cpp.

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

5255 {
5256  switch (mCurrentElement)
5257  {
5258  case StateTemplateVariable:
5259 
5260  if (strcmp(pszName, "StateTemplateVariable"))
5262  pszName, "StateTemplateVariable", mParser.getCurrentLineNumber());
5263 
5266 
5267  /* Tell the parent element we are done. */
5268  mParser.onEndElement(pszName);
5269  break;
5270 
5271  case UNKNOWN_ELEMENT:
5273  break;
5274 
5275  default:
5277  pszName, "???", mParser.getCurrentLineNumber());
5278  break;
5279  }
5280 
5281  return;
5282 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::StateTemplateVariableElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 5216 of file CCopasiXMLParser.cpp.

References CCopasiMessage::EXCEPTION, fatalError, CKeyFactory::get(), SCopasiXMLParserCommon::KeyMap, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::StateVariableList, and UNKNOWN_ELEMENT.

5218 {
5219  const char * ObjectReference;
5220  CModelEntity * pME;
5221 
5222  mCurrentElement++; /* We should always be on the next element */
5223 
5224  switch (mCurrentElement)
5225  {
5226  case StateTemplateVariable:
5227 
5228  if (strcmp(pszName, "StateTemplateVariable"))
5230  pszName, "StateTemplateVariable", mParser.getCurrentLineNumber());
5231 
5232  ObjectReference = mParser.getAttributeValue("objectReference",
5233  papszAttrs);
5234  pME = dynamic_cast< CModelEntity * >(mCommon.KeyMap.get(ObjectReference));
5235 
5236  if (pME != NULL)
5237  mCommon.StateVariableList.push_back(pME);
5238  else
5239  fatalError();
5240 
5241  break;
5242 
5243  default:
5247  mParser.onStartElement(pszName, papszAttrs);
5248  break;
5249  }
5250 
5251  return;
5252 }
UnknownElement mUnknownElement
std::vector< CModelEntity * > StateVariableList
CCopasiObject * get(const std::string &key)
#define fatalError()
const char * getAttributeValue(const std::string &name, const char **attributes, const bool &required=true) const
Definition: CExpat.h:685
#define MCXML
#define UNKNOWN_ELEMENT
virtual void onStartElement(const XML_Char *pszName, const XML_Char **papszAttrs)
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
int getCurrentLineNumber() const
Definition: CExpat.h:470

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