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

Public Member Functions

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

Member Enumeration Documentation

Enum of invoked parsers

Enumerator
SourceParameter 

Definition at line 632 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 5030 of file CCopasiXMLParser.cpp.

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 5085 of file CCopasiXMLParser.cpp.

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

5086 {
5087  switch (mCurrentElement)
5088  {
5089  case SourceParameter:
5090 
5091  if (strcmp(pszName, "SourceParameter"))
5093  pszName, "SourceParameter", mParser.getCurrentLineNumber());
5094 
5097 
5098  /* Tell the parent element we are done. */
5099  mParser.onEndElement(pszName);
5100  break;
5101 
5102  case UNKNOWN_ELEMENT:
5104  break;
5105 
5106  default:
5108  pszName, "???", mParser.getCurrentLineNumber());
5109  break;
5110  }
5111 
5112  return;
5113 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::SourceParameterElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 5035 of file CCopasiXMLParser.cpp.

References CCopasiMessage::EXCEPTION, CKeyFactory::get(), CModelEntity::getKey(), CCopasiParameter::getKey(), CCopasiObject::getObjectName(), CFunctionParameter::getType(), SCopasiXMLParserCommon::KeyMap, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pFunctionVariable, CFunctionParameterMap::pUnmappedObject, CCopasiObject::setObjectName(), SCopasiXMLParserCommon::SourceParameterKeys, UNKNOWN_ELEMENT, and CFunctionParameter::VINT32.

5037 {
5038  mCurrentElement++; /* We should always be on the next element */
5039 
5040  const char * Reference;
5041  CCopasiObject * pObject;
5042  CCopasiParameter * pParameter;
5043  CModelEntity * pME;
5044 
5045  switch (mCurrentElement)
5046  {
5047  case SourceParameter:
5048 
5049  if (strcmp(pszName, "SourceParameter"))
5051  pszName, "SourceParameter", mParser.getCurrentLineNumber());
5052 
5053  Reference =
5054  mParser.getAttributeValue("reference", papszAttrs);
5055 
5056  pObject = mCommon.KeyMap.get(Reference);
5057 
5058  if ((pParameter = dynamic_cast< CCopasiParameter * >(pObject)))
5059  {
5060  // We need to assure that the parameter name for variables which are not
5061  // of type vector match.
5064 
5066  }
5067  else if ((pME = dynamic_cast<CModelEntity*>(pObject)))
5069  else
5071 
5072  break;
5073 
5074  default:
5078  mParser.onStartElement(pszName, papszAttrs);
5079  break;
5080  }
5081 
5082  return;
5083 }
const CFunctionParameter::DataType & getType() const
UnknownElement mUnknownElement
std::map< std::string, std::vector< std::string > > SourceParameterKeys
const std::string & getObjectName() const
CCopasiObject * get(const std::string &key)
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)
virtual const std::string & getKey() const
virtual const std::string & getKey() const
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
static CCopasiObject * pUnmappedObject
int getCurrentLineNumber() const
Definition: CExpat.h:470
CFunctionParameter * pFunctionVariable
bool setObjectName(const std::string &name)

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