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

Public Member Functions

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

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

Member Enumeration Documentation

Enumerator
ListOfTasks 
Task 

Definition at line 2141 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 8381 of file CCopasiXMLParser.cpp.

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 8433 of file CCopasiXMLParser.cpp.

References CCopasiVectorN< CType >::add(), CCopasiMessage::EXCEPTION, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pCurrentTask, SCopasiXMLParserCommon::pTaskList, START_ELEMENT, and UNKNOWN_ELEMENT.

8434 {
8435  switch (mCurrentElement)
8436  {
8437  case ListOfTasks:
8438 
8439  if (strcmp(pszName, "ListOfTasks"))
8441  pszName, "ListOfTasks", mParser.getCurrentLineNumber());
8442 
8445  mParser.onEndElement(pszName);
8446  break;
8447 
8448  case Task:
8449 
8450  if (strcmp(pszName, "Task"))
8452  pszName, "Task", mParser.getCurrentLineNumber());
8453 
8454  if (mCommon.pCurrentTask != NULL)
8455  {
8457  mCommon.pCurrentTask = NULL;
8458  }
8459 
8461  break;
8462 
8463  case UNKNOWN_ELEMENT:
8465  break;
8466 
8467  default:
8469  pszName, "???", mParser.getCurrentLineNumber());
8470  break;
8471  }
8472 
8473  return;
8474 }
CCopasiVectorN< CCopasiTask > * pTaskList
#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::ListOfTasksElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 8386 of file CCopasiXMLParser.cpp.

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

8388 {
8389  mCurrentElement++; /* We should always be on the next element */
8390 
8391  switch (mCurrentElement)
8392  {
8393  case ListOfTasks:
8394 
8395  if (strcmp(pszName, "ListOfTasks"))
8397  pszName, "ListOfTasks", mParser.getCurrentLineNumber());
8398 
8399  if (!mCommon.pTaskList)
8400  {
8401  mCommon.pTaskList = new CCopasiVectorN<CCopasiTask>("TaskList");
8402  }
8403 
8404  break;
8405 
8406  case Task:
8407 
8408  if (strcmp(pszName, "Task"))
8410  pszName, "Task", mParser.getCurrentLineNumber());
8411 
8412  /* If we do not have a task element handler, we create one */
8413  if (!mpCurrentHandler)
8414  {
8415  mpCurrentHandler = new TaskElement(mParser, mCommon);
8416  }
8417 
8419  mpCurrentHandler->start(pszName, papszAttrs);
8420  break;
8421 
8422  default:
8426  mParser.onStartElement(pszName, papszAttrs);
8427  break;
8428  }
8429 
8430  return;
8431 }
CCopasiVectorN< CCopasiTask > * pTaskList
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
int getCurrentLineNumber() const
Definition: CExpat.h:470

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