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

Public Member Functions

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

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

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Destructor

Definition at line 8243 of file CCopasiXMLParser.cpp.

8244 {}

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 8315 of file CCopasiXMLParser.cpp.

References CCopasiVector< T >::add(), CCopasiMessage::EXCEPTION, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pCurrentLayout, SCopasiXMLParserCommon::pLayoutList, START_ELEMENT, and UNKNOWN_ELEMENT.

8316 {
8317  switch (mCurrentElement)
8318  {
8319  case ListOfLayouts:
8320 
8321  if (strcmp(pszName, "ListOfLayouts"))
8323  pszName, "ListOfLayouts", mParser.getCurrentLineNumber());
8324 
8326 
8327  //reset handler
8329  //call parent handler
8330  mParser.onEndElement(pszName);
8331  break;
8332 
8333  case Layout:
8334 
8335  if (strcmp(pszName, "Layout"))
8337  pszName, "Layout", mParser.getCurrentLineNumber());
8338 
8339  //workload
8341  //delete mCommon.pCurrentLayout; //??
8342  mCommon.pCurrentLayout = NULL;
8343 
8344  //tell the handler where to continue
8346 
8348 
8349  break;
8350 
8352 
8353  if (strcmp(pszName, "ListOfGlobalRenderInformation"))
8355  pszName, "ListOfGlobalRenderInformation", mParser.getCurrentLineNumber());
8356 
8357  //tell the handler where to continue
8359 
8361  break;
8362 
8363  case UNKNOWN_ELEMENT:
8364  mCurrentElement = mLastKnownElement;
8365  break;
8366 
8367  default:
8369  pszName, "???", mParser.getCurrentLineNumber());
8370  break;
8371  }
8372 
8373  return;
8374 }
CListOfLayouts * pLayoutList
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
virtual bool add(const CType &src)
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ListOfLayoutsElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 8246 of file CCopasiXMLParser.cpp.

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

8248 {
8249  this->mCurrentElement++; /* We should always be on the next element */
8250  // we set the handler to NULL so that we can see if a handler was
8251  // created in this call
8252  this->mpCurrentHandler = NULL;
8253 
8254  switch (this->mCurrentElement)
8255  {
8256  case ListOfLayouts:
8257 
8258  if (strcmp(pszName, "ListOfLayouts"))
8260  pszName, "ListOfLayouts", this->mParser.getCurrentLineNumber());
8261 
8262  //workload
8263  if (!this->mCommon.pLayoutList)
8264  {
8265  this->mCommon.pLayoutList = new CListOfLayouts;
8266  }
8267 
8268  // we need to jump out of this method here
8269  // because otherwise the call at the end would
8270  // call this method again in an endless loop
8271  return;
8272  break;
8273 
8274  case Layout:
8275 
8276  if (!strcmp(pszName, "Layout"))
8277  {
8278  this->mLastKnownElement = Layout;
8279  this->mpCurrentHandler = new LayoutElement(this->mParser, this->mCommon);
8280  }
8281 
8282  break;
8283 
8285 
8286  if (!strcmp(pszName, "ListOfGlobalRenderInformation"))
8287  {
8289  this->mpCurrentHandler = new ListOfGlobalRenderInformationElement(this->mParser, this->mCommon);
8290  }
8291 
8292  break;
8293 
8294  default:
8297  break;
8298  }
8299 
8300  // if we created a handler in this call, we add it to the stack
8301  if (this->mpCurrentHandler != NULL)
8302  {
8304  }
8305 
8306  // we call the current handler
8307  // if we created one, the new one will be called, otherwise
8308  // the one for ListOfLayouts should be the current one
8309  // and this method will be called again
8310  this->mParser.onStartElement(pszName, papszAttrs);
8311 
8312  return;
8313 }
CListOfLayouts * pLayoutList
#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: