COPASI API  4.16.103
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CXMLElementHandler< CType, CCommon > Class Template Reference

#include <CXMLHandler.h>

Inheritance diagram for CXMLElementHandler< CType, CCommon >:
Inheritance graph
[legend]
Collaboration diagram for CXMLElementHandler< CType, CCommon >:
Collaboration graph
[legend]

Public Member Functions

 CXMLElementHandler (CType &parser, CCommon &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 ()
 

Protected Member Functions

void addFix (const std::string &key, CCopasiObject *pObject)
 
void deleteCurrentHandler ()
 

Protected Attributes

CCommon & mCommon
 
C_INT32 mCurrentElement
 
C_INT32 mLastKnownElement
 
CType & mParser
 
CXMLElementHandlermpCurrentHandler
 

Detailed Description

template<class CType, class CCommon>
class CXMLElementHandler< CType, CCommon >

Definition at line 35 of file CXMLHandler.h.

Constructor & Destructor Documentation

template<class CType, class CCommon>
CXMLElementHandler< CType, CCommon >::CXMLElementHandler ( CType &  parser,
CCommon &  common 
)
inline

Constructor

Definition at line 69 of file CXMLHandler.h.

69  :
70  mParser(parser),
71  mCommon(common),
72  mCurrentElement(-1),
73  mpCurrentHandler(NULL),
75  {}
CCommon & mCommon
Definition: CXMLHandler.h:47
CXMLElementHandler * mpCurrentHandler
Definition: CXMLHandler.h:57
C_INT32 mLastKnownElement
Definition: CXMLHandler.h:62
C_INT32 mCurrentElement
Definition: CXMLHandler.h:52
template<class CType, class CCommon>
virtual CXMLElementHandler< CType, CCommon >::~CXMLElementHandler ( )
inlinevirtual

Destructor

Definition at line 80 of file CXMLHandler.h.

80 {}

Member Function Documentation

template<class CType, class CCommon>
void CXMLElementHandler< CType, CCommon >::addFix ( const std::string &  key,
CCopasiObject pObject 
)
inlineprotected

Definition at line 119 of file CXMLHandler.h.

120  {
121  if (!mCommon.KeyMap.addFix(key, pObject))
122  {
123  CCopasiMessage(CCopasiMessage::EXCEPTION, MCXML + 22, key.c_str(), mParser.getCurrentLineNumber());
124  }
125  }
#define MCXML
CCommon & mCommon
Definition: CXMLHandler.h:47
template<class CType, class CCommon>
void CXMLElementHandler< CType, CCommon >::deleteCurrentHandler ( )
inlineprotected

This assures that we do not accidentally delete common parser handlers.

Definition at line 105 of file CXMLHandler.h.

106  {
107  if (mpCurrentHandler != NULL &&
108  mpCurrentHandler != &mParser.mUnknownElement &&
109  mpCurrentHandler != &mParser.mCharacterDataElement &&
110  mpCurrentHandler != &mParser.mListOfUnsupportedAnnotationsElement &&
111  mpCurrentHandler != &mParser.mCommentElement &&
112  mpCurrentHandler != &mParser.mMiriamAnnotationElement)
113  {
114  delete mpCurrentHandler;
115  mpCurrentHandler = NULL;
116  }
117  }
CXMLElementHandler * mpCurrentHandler
Definition: CXMLHandler.h:57
template<class CType, class CCommon>
virtual void CXMLElementHandler< CType, CCommon >::end ( const XML_Char *  C_UNUSEDpszName)
inlinevirtual

End element handler

Parameters
constXML_Char *pszName

Definition at line 94 of file CXMLHandler.h.

94 {}
template<class CType, class CCommon>
virtual void CXMLElementHandler< CType, CCommon >::reset ( )
inlinevirtual

Reset the element handler to start values.

Reimplemented in CCopasiXMLParser::ParameterDescriptionElement.

Definition at line 99 of file CXMLHandler.h.

99 {}
template<class CType, class CCommon>
virtual void CXMLElementHandler< CType, CCommon >::start ( const XML_Char *  C_UNUSEDpszName,
const XML_Char **  C_UNUSEDpapszAttrs 
)
inlinevirtual

Start element handler

Parameters
constXML_Char *pszName
constXML_Char **papszAttrs

Definition at line 87 of file CXMLHandler.h.

88  {}

Member Data Documentation

template<class CType, class CCommon>
CCommon& CXMLElementHandler< CType, CCommon >::mCommon
protected

The shared elements between all element handlers of a parser

Definition at line 47 of file CXMLHandler.h.

Referenced by CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon >::addFix().

template<class CType, class CCommon>
C_INT32 CXMLElementHandler< CType, CCommon >::mCurrentElement
protected

The currently processed element.

Definition at line 52 of file CXMLHandler.h.

template<class CType, class CCommon>
C_INT32 CXMLElementHandler< CType, CCommon >::mLastKnownElement
protected

Definition at line 62 of file CXMLHandler.h.

template<class CType, class CCommon>
CType& CXMLElementHandler< CType, CCommon >::mParser
protected
template<class CType, class CCommon>
CXMLElementHandler* CXMLElementHandler< CType, CCommon >::mpCurrentHandler
protected

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