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

Public Member Functions

virtual void end (const XML_Char *pszName)
 
 LayoutElement (CCopasiXMLParser &parser, SCopasiXMLParserCommon &common)
 
virtual void start (const XML_Char *pszName, const XML_Char **papszAttrs)
 
virtual ~LayoutElement ()
 
- 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 {
  Layout = 0, Dimensions, ListOfCompartmentGlyphs, ListOfMetabGlyphs,
  ListOfReactionGlyphs, ListOfTextGlyphs, ListOfAdditionalGOs, ListOfLocalRenderInformation
}
 

Private Attributes

size_t mLineNumber
 

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

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 8009 of file CCopasiXMLParser.cpp.

8010 {}

Member Function Documentation

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

Definition at line 8135 of file CCopasiXMLParser.cpp.

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

8136 {
8137  if (!strcmp(pszName, "Layout"))
8138  {
8141 
8142  /* Tell the parent element we are done. */
8143  mParser.onEndElement(pszName);
8144  }
8145  else
8146  {
8147  switch (mCurrentElement)
8148  {
8149  // case Layout:
8150  // if (strcmp(pszName, "Layout"))
8151  // CCopasiMessage(CCopasiMessage::EXCEPTION, MCXML + 11,
8152  // pszName, "Layout", mParser.getCurrentLineNumber());
8153  // mParser.popElementHandler();
8154  // mCurrentElement = START_ELEMENT;
8155  //
8156  // /* Tell the parent element we are done. */
8157  // mParser.onEndElement(pszName);
8158  // break;
8159 
8160  case Dimensions:
8161 
8162  if (strcmp(pszName, "Dimensions"))
8164  pszName, "Dimensions", mParser.getCurrentLineNumber());
8165 
8167  break;
8168 
8170 
8171  if (strcmp(pszName, "ListOfCompartmentGlyphs"))
8173  pszName, "ListOfCompartmentGlyphs", mParser.getCurrentLineNumber());
8174 
8176  break;
8177 
8178  case ListOfMetabGlyphs:
8179 
8180  if (strcmp(pszName, "ListOfMetabGlyphs"))
8182  pszName, "ListOfMetabGlyphs", mParser.getCurrentLineNumber());
8183 
8185  break;
8186 
8187  case ListOfReactionGlyphs:
8188 
8189  if (strcmp(pszName, "ListOfReactionGlyphs"))
8191  pszName, "ListOfReactionGlyphs", mParser.getCurrentLineNumber());
8192 
8194  break;
8195 
8196  case ListOfTextGlyphs:
8197 
8198  if (strcmp(pszName, "ListOfTextGlyphs"))
8200  pszName, "ListOfTextGlyphs", mParser.getCurrentLineNumber());
8201 
8203  break;
8204 
8205  case ListOfAdditionalGOs:
8206 
8207  if (strcmp(pszName, "ListOfAdditionalGraphicalObjects"))
8209  pszName, "ListOfAdditionalGraphicalObjects", mParser.getCurrentLineNumber());
8210 
8212  break;
8213 
8215 
8216  if (strcmp(pszName, "ListOfRenderInformation"))
8218  pszName, "ListOfRenderInformation", mParser.getCurrentLineNumber());
8219 
8221  break;
8222 
8223  case UNKNOWN_ELEMENT:
8225  break;
8226 
8227  default:
8229  pszName, "???", mParser.getCurrentLineNumber());
8230  break;
8231  }
8232  }
8233 
8234  // deleteCurrentHandler(); //TODO ??? is not done in ModelElement
8235  return;
8236 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::LayoutElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Definition at line 8012 of file CCopasiXMLParser.cpp.

References CCopasiMessage::EXCEPTION, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pCurrentLayout, CLayout::setDimensions(), CCopasiObject::setObjectName(), and UNKNOWN_ELEMENT.

8013 {
8014  mCurrentElement++; /* We should always be on the next element */
8015  mpCurrentHandler = NULL;
8016  mLineNumber = (size_t) - 1;
8017 
8018  switch (mCurrentElement)
8019  {
8020  case Layout:
8022 
8023  if (strcmp(pszName, "Layout"))
8025  pszName, "Layout", mParser.getCurrentLineNumber());
8026 
8027  {
8028  //workload
8029  const char * key;
8030  const char * name;
8031  key = mParser.getAttributeValue("key", papszAttrs);
8032  name = mParser.getAttributeValue("name", papszAttrs);
8033 
8034  mCommon.pCurrentLayout = new CLayout();
8037  }
8038  return;
8039  break;
8040 
8041  case Dimensions:
8042 
8043  if (!strcmp(pszName, "Dimensions"))
8044  {
8046 
8047  //workload
8048  const char * attr;
8049  attr = mParser.getAttributeValue("width", papszAttrs);
8050  double tmpW = CCopasiXMLInterface::DBL(attr);
8051  attr = mParser.getAttributeValue("height", papszAttrs);
8052  double tmpH = CCopasiXMLInterface::DBL(attr);
8054 
8055  //we are finished with this tag
8056  return;
8057  }
8058 
8059  break;
8060 
8062 
8063  if (!strcmp(pszName, "ListOfCompartmentGlyphs"))
8064  {
8066  mpCurrentHandler = new ListOfCompartmentGlyphsElement(mParser, mCommon);
8067  }
8068 
8069  break;
8070 
8071  case ListOfMetabGlyphs:
8072 
8073  if (!strcmp(pszName, "ListOfMetabGlyphs"))
8074  {
8076  mpCurrentHandler = new ListOfMetabGlyphsElement(mParser, mCommon);
8077  }
8078 
8079  break;
8080 
8081  case ListOfReactionGlyphs:
8082 
8083  if (!strcmp(pszName, "ListOfReactionGlyphs"))
8084  {
8086  mpCurrentHandler = new ListOfReactionGlyphsElement(mParser, mCommon);
8087  }
8088 
8089  break;
8090 
8091  case ListOfTextGlyphs:
8092 
8093  if (!strcmp(pszName, "ListOfTextGlyphs"))
8094  {
8096  mpCurrentHandler = new ListOfTextGlyphsElement(mParser, mCommon);
8097  }
8098 
8099  break;
8100 
8101  case ListOfAdditionalGOs:
8102 
8103  if (!strcmp(pszName, "ListOfAdditionalGraphicalObjects"))
8104  {
8106  mpCurrentHandler = new ListOfAdditionalGOsElement(mParser, mCommon);
8107  }
8108 
8109  break;
8110 
8112 
8113  if (!strcmp(pszName, "ListOfRenderInformation"))
8114  {
8116  mpCurrentHandler = new ListOfLocalRenderInformationElement(mParser, mCommon);
8117  }
8118 
8119  break;
8120 
8121  default:
8124  break;
8125  }
8126 
8127  if (mpCurrentHandler)
8129 
8130  mParser.onStartElement(pszName, papszAttrs);
8131 
8132  return;
8133 }
UnknownElement mUnknownElement
void setDimensions(const CLDimensions &d)
Definition: CLayout.h:77
const char * getAttributeValue(const std::string &name, const char **attributes, const bool &required=true) const
Definition: CExpat.h:685
#define MCXML
void addFix(const std::string &key, CCopasiObject *pObject)
Definition: CXMLHandler.h:119
#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
bool setObjectName(const std::string &name)

Member Data Documentation

size_t CCopasiXMLParser::LayoutElement::mLineNumber
private

Definition at line 3610 of file CCopasiXMLParser.h.


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