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

Public Member Functions

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

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

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
CallParameter 
SourceParameter 

Definition at line 673 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 4927 of file CCopasiXMLParser.cpp.

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 4986 of file CCopasiXMLParser.cpp.

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

4987 {
4988  switch (mCurrentElement)
4989  {
4990  case CallParameter:
4991 
4992  if (strcmp(pszName, "CallParameter"))
4994  pszName, "CallParameter", mParser.getCurrentLineNumber());
4995 
4998 
4999  /* Tell the parent element we are done. */
5000  mParser.onEndElement(pszName);
5001  break;
5002 
5003  case SourceParameter:
5004 
5005  if (strcmp(pszName, "SourceParameter"))
5007  pszName, "SourceParameter", mParser.getCurrentLineNumber());
5008 
5010  break;
5011 
5012  case UNKNOWN_ELEMENT:
5013  mCurrentElement = mLastKnownElement;
5014  break;
5015 
5016  default:
5018  pszName, "???", mParser.getCurrentLineNumber());
5019  break;
5020  }
5021 
5022  return;
5023 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::CallParameterElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 4932 of file CCopasiXMLParser.cpp.

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

4934 {
4935  const char * FunctionParameter;
4936 
4937  mCurrentElement++; /* We should always be on the next element */
4938 
4939  switch (mCurrentElement)
4940  {
4941  case CallParameter:
4942 
4943  if (strcmp(pszName, "CallParameter"))
4945  pszName, "CallParameter", mParser.getCurrentLineNumber());
4946 
4947  FunctionParameter =
4948  mParser.getAttributeValue("functionParameter", papszAttrs);
4949 
4951  dynamic_cast< CFunctionParameter* >(mCommon.KeyMap.get(FunctionParameter));
4952 
4954  {
4955  fatalError();
4956  }
4957 
4958  break;
4959 
4960  case SourceParameter:
4961 
4962  if (strcmp(pszName, "SourceParameter"))
4964  pszName, "SourceParameter", mParser.getCurrentLineNumber());
4965 
4966  /* If we do not have a SourceParameter element handler we create one. */
4967  if (!mpCurrentHandler)
4968  mpCurrentHandler = new SourceParameterElement(mParser, mCommon);
4969 
4970  /* Push the SourceParameter element handler on the stack and call it. */
4972  mpCurrentHandler->start(pszName, papszAttrs);
4973  break;
4974 
4975  default:
4979  mParser.onStartElement(pszName, papszAttrs);
4980  break;
4981  }
4982 
4983  return;
4984 }
UnknownElement mUnknownElement
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)
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
CFunctionParameter * pFunctionVariable

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