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

Public Member Functions

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

Member Enumeration Documentation

Enumerator
ChannelSpec 

Definition at line 1866 of file CCopasiXMLParser.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 5682 of file CCopasiXMLParser.cpp.

5683 {}

Member Function Documentation

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

End element handler

Parameters
constXML_Char *pszName

Definition at line 5749 of file CCopasiXMLParser.cpp.

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

5750 {
5751  switch (mCurrentElement)
5752  {
5753  case ChannelSpec:
5754 
5755  if (strcmp(pszName, "ChannelSpec"))
5757  pszName, "ChannelSpec", mParser.getCurrentLineNumber());
5758 
5761  mParser.onEndElement(pszName);
5762  break;
5763 
5764  case UNKNOWN_ELEMENT:
5766  break;
5767 
5768  default:
5770  pszName, "???", mParser.getCurrentLineNumber());
5771  break;
5772  }
5773 
5774  return;
5775 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ChannelSpecElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 5685 of file CCopasiXMLParser.cpp.

References CCopasiMessage::EXCEPTION, CPlotDataChannelSpec::max, max, CPlotDataChannelSpec::maxAutoscale, CCopasiXMLParser::mCommon, MCXML, CPlotDataChannelSpec::min, min, CPlotDataChannelSpec::minAutoscale, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pCurrentChannelSpec, and UNKNOWN_ELEMENT.

5686 {
5687  mCurrentElement++; /* We should always be on hte next element */
5688  mpCurrentHandler = NULL;
5689  std::string name;
5690  double min;
5691  double max;
5692  const char* sMin;
5693  const char* sMax;
5694 
5695  switch (mCurrentElement)
5696  {
5697  case ChannelSpec:
5698 
5699  if (strcmp(pszName, "ChannelSpec"))
5701  pszName, "ChannelSpec", mParser.getCurrentLineNumber());
5702 
5703  // create a new CPlotSpecification element depending on the type
5704  name = mParser.getAttributeValue("cn", papszAttrs);
5705 
5707  sMin = mParser.getAttributeValue("min", papszAttrs, false);
5708 
5709  if (sMin == NULL)
5710  {
5712  }
5713  else
5714  {
5715  min = CCopasiXMLInterface::DBL(sMin);
5717  }
5718 
5719  sMax = mParser.getAttributeValue("max", papszAttrs, false);
5720 
5721  if (sMax == NULL)
5722  {
5724  }
5725  else
5726  {
5727  max = CCopasiXMLInterface::DBL(sMax);
5729  }
5730 
5731  return;
5732  break;
5733 
5734  default:
5738  break;
5739  }
5740 
5741  if (mpCurrentHandler)
5743 
5744  mParser.onStartElement(pszName, papszAttrs);
5745 
5746  return;
5747 }
UnknownElement mUnknownElement
const char * getAttributeValue(const std::string &name, const char **attributes, const bool &required=true) const
Definition: CExpat.h:685
#define MCXML
CPlotDataChannelSpec * pCurrentChannelSpec
#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
#define min(a, b)
Definition: f2c.h:175
#define max(a, b)
Definition: f2c.h:176

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