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

Public Member Functions

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

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

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
ListOfCompartments 
Compartment 

Definition at line 1408 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 2150 of file CCopasiXMLParser.cpp.

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 2197 of file CCopasiXMLParser.cpp.

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

2198 {
2199  switch (mCurrentElement)
2200  {
2201  case ListOfCompartments:
2202 
2203  if (strcmp(pszName, "ListOfCompartments"))
2205  pszName, "ListOfCompartments", mParser.getCurrentLineNumber());
2206 
2209 
2210  /* Tell the parent element we are done. */
2211  mParser.onEndElement(pszName);
2212  break;
2213 
2214  case Compartment:
2215 
2216  if (strcmp(pszName, "Compartment"))
2218  pszName, "Compartment", mParser.getCurrentLineNumber());
2219 
2221  break;
2222 
2223  case UNKNOWN_ELEMENT:
2224  mCurrentElement = mLastKnownElement;
2225  break;
2226 
2227  default:
2229  pszName, "???", mParser.getCurrentLineNumber());
2230  break;
2231  }
2232 
2233  return;
2234 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ListOfCompartmentsElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 2155 of file CCopasiXMLParser.cpp.

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

2157 {
2158  mCurrentElement++; /* We should always be on the next element */
2159 
2160  switch (mCurrentElement)
2161  {
2162  case ListOfCompartments:
2163 
2164  if (strcmp(pszName, "ListOfCompartments"))
2166  pszName, "ListOfCompartments", mParser.getCurrentLineNumber());
2167 
2169  break;
2170 
2171  case Compartment:
2172 
2173  if (strcmp(pszName, "Compartment"))
2175  pszName, "Compartment", mParser.getCurrentLineNumber());
2176 
2177  /* If we do not have a function element handler we create one. */
2178  if (!mpCurrentHandler)
2179  mpCurrentHandler = new CompartmentElement(mParser, mCommon);
2180 
2181  /* Push the Compartment element handler on the stack and call it. */
2183  mpCurrentHandler->start(pszName, papszAttrs);
2184  break;
2185 
2186  default:
2190  mParser.onStartElement(pszName, papszAttrs);
2191  break;
2192  }
2193 
2194  return;
2195 }
UnknownElement mUnknownElement
#define MCXML
#define UNKNOWN_ELEMENT
virtual void onStartElement(const XML_Char *pszName, const XML_Char **papszAttrs)
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
CCopasiVectorNS< CCompartment > & getCompartments()
Definition: CModel.cpp:1145
virtual void start(const XML_Char *C_UNUSED(pszName), const XML_Char **C_UNUSED(papszAttrs))
Definition: CXMLHandler.h:87
virtual void clear()
int getCurrentLineNumber() const
Definition: CExpat.h:470

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