30#include <sbml/util/List.h>
33#include <sbml/SyntaxChecker.h>
44#include <sbml/xml/XMLAttributes.h>
45#include <sbml/xml/XMLOutputStream.h>
46#include <sbml/xml/XMLNode.h>
47#include <sbml/xml/XMLInputStream.h>
48#include <sbml/xml/XMLNamespaces.h>
49#include <sbml/xml/XMLToken.h>
54LIBNUML_CPP_NAMESPACE_BEGIN
163 virtual const std::string&
getId ()
const;
173 virtual const std::string&
getName ()
const;
211 virtual LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces*
getNamespaces()
const ;
372 int setMetaId (
const std::string& metaid);
390 virtual int setId (
const std::string& sid);
437 int setNamespaces(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces* xmlns);
592 void read (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream& stream);
598 void write (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& stream)
const;
611 virtual void writeElements (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& stream)
const;
638 virtual int setAnnotation(
const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode* annotation);
643 const std::string elementURI =
"");
646 int setNotes(
const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode* notes);
647 int setNotes(
const std::string& notes,
bool addXHTMLMarkup =
false);
648 int appendNotes(
const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode* notes);
653 LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode*
getNotes()
const;
655 LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode*
getAnnotation()
const;
669 virtual void writeXMLNS(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& stream)
const;
687 NMBase (
const std::string&
id =
"",
const std::string& name =
"");
694 NMBase (
unsigned int level,
unsigned int version);
718 virtual NMBase*
createObject (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream& stream);
727 virtual bool readOtherXML (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream& stream);
769 ,
const unsigned int level = 2
770 ,
const unsigned int version = 3
771 ,
const std::string& details =
"" );
778 const unsigned int level,
779 const unsigned int version,
780 const std::string element );
787 const unsigned int level,
788 const unsigned int version );
795 const unsigned int level,
796 const unsigned int version,
797 std::string element);
805 virtual void readAttributes (
const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLAttributes& attributes);
818 virtual void writeAttributes (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& stream)
const;
861 void checkUnitSyntax(
unsigned int flag = 0);
868 void checkDefaultNamespace(
const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces* xmlns,
const std::string& elementName);
876 void checkXHTML(
const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *);
890 LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode*
mNotes;
922 void setNMBaseFields (
const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLToken& element);
928 bool readAnnotation (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream& stream);
934 bool readNotes (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream& stream);
941LIBNUML_CPP_NAMESPACE_END
949LIBNUML_CPP_NAMESPACE_BEGIN
988LIBSBML_CPP_NAMESPACE_QUALIFIER
XMLNode_t *
994NMBase_getNotesString (
NMBase_t *sb);
998LIBSBML_CPP_NAMESPACE_QUALIFIER
XMLNode_t *
1004NMBase_getAnnotationString (
NMBase_t *sb);
1014NMBase_isSetNotes (
const NMBase_t *sb);
1019NMBase_isSetAnnotation (
const NMBase_t *sb);
1034NMBase_setNotes (
NMBase_t *sb, LIBSBML_CPP_NAMESPACE_QUALIFIER
XMLNode_t *notes);
1039NMBase_setNotesString (
NMBase_t *sb,
char *notes);
1044NMBase_appendNotes (
NMBase_t *sb, LIBSBML_CPP_NAMESPACE_QUALIFIER
XMLNode_t *notes);
1049NMBase_appendNotesString (
NMBase_t *sb,
char *notes);
1054NMBase_setAnnotation (
NMBase_t *sb, LIBSBML_CPP_NAMESPACE_QUALIFIER
XMLNode_t *annotation);
1059NMBase_setAnnotationString (
NMBase_t *sb,
char *annotation);
1064NMBase_appendAnnotation (
NMBase_t *sb, LIBSBML_CPP_NAMESPACE_QUALIFIER
XMLNode_t *annotation);
1069NMBase_appendAnnotationString (
NMBase_t *sb,
char *annotation);
1102LIBNUML_CPP_NAMESPACE_END
LIBNUML_EXTERN int NMBase_setMetaId(NMBase_t *sb, const char *metaid)
Sets the value of the "metaid" attribute of the given object.
Definition NMBase.cpp:2460
LIBNUML_EXTERN const char * NMBase_getElementName(const NMBase_t *sb)
Returns the XML element name of the given structure.
Definition NMBase.cpp:2543
LIBNUML_EXTERN const char * NMBase_getMetaId(NMBase_t *sb)
Returns the value of the "metaid" attribute of the given NMBase_t structure.
Definition NMBase.cpp:2311
LIBNUML_EXTERN const NMBase_t * NMBase_getParentNUMLObject(NMBase_t *sb)
Returns the parent NMBase_t structure of the given NMBase_t structure.
Definition NMBase.cpp:2375
LIBNUML_EXTERN NUMLTypeCode_t NMBase_getTypeCode(const NMBase_t *sb)
Returns the libNUML type code for the given structure.
Definition NMBase.cpp:2525
LIBNUML_EXTERN int NMBase_setNamespaces(NMBase_t *sb, LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces_t *xmlns)
Sets the namespaces relevant of this NUML object.
Definition NMBase.cpp:2482
LIBNUML_EXTERN int NMBase_hasValidLevelVersionNamespaceCombination(NMBase_t *sb)
Predicate returning nonzero true or false depending on whether the object's level/version and namespa...
Definition NMBase.cpp:2603
LIBNUML_EXTERN unsigned int NMBase_getColumn(const NMBase_t *sb)
Returns the column number on which the given object first appears in the XML representation of the NU...
Definition NMBase.cpp:2579
LIBNUML_EXTERN unsigned int NMBase_getLevel(const NMBase_t *sb)
Returns the NUML Level of the overall NUML document.
Definition NMBase.cpp:2391
LIBNUML_EXTERN int NMBase_isSetMetaId(const NMBase_t *sb)
Predicate returning nonzero true or false depending on whether the given structure's "metaid" attribu...
Definition NMBase.cpp:2424
LIBNUML_EXTERN const NUMLDocument_t * NMBase_getNUMLDocument(NMBase_t *sb)
Returns the value of the "id" attribute of the given NMBase_t structure.
Definition NMBase.cpp:2359
LIBNUML_EXTERN unsigned int NMBase_getVersion(const NMBase_t *sb)
Returns the Version within the NUML Level of the overall NUML document.
Definition NMBase.cpp:2408
LIBNUML_EXTERN unsigned int NMBase_getLine(const NMBase_t *sb)
Returns the line number on which the given object first appears in the XML representation of the NUML...
Definition NMBase.cpp:2561
LIBNUML_EXTERN int NMBase_unsetMetaId(NMBase_t *sb)
Unsets the "metaid" attribute of the given object.
Definition NMBase.cpp:2501
NUMLTypeCode_t
An enumeration of NUML types to help identify NUML objects at runtime.
Definition NUMLTypeCodes.h:34
std::string getNotesString() const
Definition NMBase.cpp:1549
bool getHasBeenDeleted()
Definition NMBase.cpp:2031
virtual LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * getNamespaces() const
Returns the content of the "annotation" subelement of this object as a character string.
Definition NMBase.cpp:242
void logUnknownElement(const std::string element, const unsigned int level, const unsigned int version)
Helper to log a common type of error.
Definition NMBase.cpp:2079
virtual int appendAnnotation(const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *annotation)
virtual bool hasRequiredElements() const
Definition NMBase.cpp:2273
unsigned int getLevel() const
Returns the NUML Level of the overall NUML document.
Definition NMBase.cpp:568
unsigned int getLine() const
Returns the line number on which this object first appears in the XML representation of the NUML docu...
Definition NMBase.cpp:342
NUMLErrorLog * getErrorLog()
Definition NMBase.cpp:2051
unsigned int mLine
Definition NMBase.h:899
void write(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream &stream) const
Writes (serializes) this NUML object by writing it to XMLOutputStream.
Definition NMBase.cpp:1666
bool hasValidLevelVersionNamespaceCombination()
Predicate returning true or false depending on whether this object's level/version and namespace valu...
Definition NMBase.cpp:441
bool isSetAnnotation() const
Definition NMBase.cpp:677
int unsetAnnotation()
Definition NMBase.cpp:1537
int appendNotes(const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *notes)
unsigned int getColumn() const
Returns the column number on which this object first appears in the XML representation of the NUML do...
Definition NMBase.cpp:352
void checkXHTML(const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *)
Checks that the XHTML is valid.
Definition NMBase.cpp:1766
NMBase & operator=(const NMBase &orig)
Assignment operator for NMBase.
Definition NMBase.cpp:168
std::string mId
Definition NMBase.h:885
bool mHasBeenDeleted
Definition NMBase.h:910
void checkAnnotation()
Checks the annotation does not declare an numl namespace.
Definition NMBase.cpp:1874
virtual NMBase * createObject(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream)
Subclasses should override this method to create, store, and then return an NUML object corresponding...
Definition NMBase.cpp:1715
virtual int setId(const std::string &sid)
Definition NMBase.cpp:413
int setNamespaces(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces *xmlns)
Sets the namespaces relevant of this NUML object.
Definition NMBase.cpp:523
virtual NUMLTypeCode_t getTypeCode() const
Returns the libnuml type code for this object.
Definition NMBase.cpp:624
virtual bool readOtherXML(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream)
Subclasses should override this method to read (and store) XHTML, MathML, etc.
Definition NMBase.cpp:2024
virtual const std::string & getName() const
Definition NMBase.cpp:233
virtual int getElementPosition() const
The NUML XML Schema is written such that the order of child elements is significant.
Definition NMBase.cpp:2041
bool isSetName() const
Definition NMBase.cpp:375
virtual const std::string & getElementName() const =0
Returns the XML element name of this object.
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * getNotes() const
Definition NMBase.cpp:1544
void logError(unsigned int id, const unsigned int level=2, const unsigned int version=3, const std::string &details="")
Convenience method for easily logging problems from within method implementations.
Definition NMBase.cpp:2120
int mDept
Definition NMBase.h:902
virtual void writeXMLNS(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream &stream) const
Subclasses should override this method to write their xmlns attriubutes (if any) to the XMLOutputStre...
Definition NMBase.cpp:1683
virtual bool accept(NUMLVisitor &v) const =0
Accepts the given NUMLVisitor for this instance of NMBase.
virtual NMBase * clone() const =0
Creates and returns a deep copy of this NMBase object.
NMBase * getParentNUMLObject()
Returns the parent NUML object.
Definition NMBase.cpp:312
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * mNotes
Definition NMBase.h:890
virtual int setAnnotation(const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *annotation)
int unsetNotes()
Definition NMBase.cpp:1530
NMBase(const std::string &id="", const std::string &name="")
Only subclasses may create NMBase objects.
Definition NMBase.cpp:68
virtual void setNUMLDocument(NUMLDocument *d)
Sets the parent NUMLDocument of this NUML object.
Definition NMBase.cpp:435
virtual void setParentNUMLObject(NMBase *sb)
Sets the parent NUML object of this NUML object.
Definition NMBase.cpp:486
virtual void writeAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream &stream) const
Subclasses should override this method to write their XML attributes to the XMLOutputStream.
Definition NMBase.cpp:2160
bool readAnnotation(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream)
Definition NMBase.cpp:1724
unsigned int getVersion() const
Returns the Version within the NUML Level of the overall NUML document.
Definition NMBase.cpp:583
bool readNotes(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream)
Definition NMBase.cpp:1962
bool isSetMetaId() const
Predicate returning true or false depending on whether this object's "metaid" attribute has been set.
Definition NMBase.cpp:363
void logEmptyString(std::string attribute, const unsigned int level, const unsigned int version, std::string element)
Helper to log a common type of error.
Definition NMBase.cpp:2097
const std::string & getMetaId() const
Returns the value of the "metaid" attribute of this object.
Definition NMBase.cpp:198
std::string getAnnotationString() const
Definition NMBase.cpp:1561
void setNUMLNamespaces(NUMLNamespaces *numlns)
Definition NMBase.cpp:632
void read(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream)
Reads (initializes) this NUML object by reading from XMLInputStream.
Definition NMBase.cpp:1586
int setMetaId(const std::string &metaid)
Sets the value of the "metaid" attribute of this object.
Definition NMBase.cpp:384
int removeTopLevelAnnotationElement(const std::string elementName, const std::string elementURI="")
Definition NMBase.cpp:901
void setNMBaseFields(const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLToken &element)
Stores the location (line and column) and any XML namespaces (for roundtripping) declared on this NUM...
Definition NMBase.cpp:2284
const NUMLDocument * getNUMLDocument() const
Returns the parent NUMLDocument object.
Definition NMBase.cpp:255
NUMLNamespaces * mNUMLNamespaces
Definition NMBase.h:896
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * getAnnotation() const
Definition NMBase.cpp:1554
NMBase * mParentNUMLObject
Definition NMBase.h:905
void logUnknownAttribute(std::string attribute, const unsigned int level, const unsigned int version, const std::string element)
Helper to log a common type of error.
Definition NMBase.cpp:2060
bool isSetNotes() const
Definition NMBase.cpp:672
NUMLNamespaces * getNUMLNamespaces() const
Definition NMBase.cpp:643
int replaceTopLevelAnnotationElement(const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *annotation)
virtual void readAttributes(const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLAttributes &attributes)
Subclasses should override this method to read values from the given XMLAttributes set into their spe...
Definition NMBase.cpp:2135
void checkOrderAndLogError(NMBase *object, int expected)
Checks that NUML element has been read in the proper order.
Definition NMBase.cpp:2178
std::string mMetaId
Definition NMBase.h:884
std::string mEmptyString
Definition NMBase.h:912
NUMLDocument * mNUML
Definition NMBase.h:888
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * mAnnotation
Definition NMBase.h:891
void syncAnnotation()
Definition NMBase.cpp:654
char * toNUML()
Returns a string that consists of the partial NUML describing this object.
Definition NMBase.cpp:1571
int unsetMetaId()
Unsets the value of the "metaid" attribute of this NUML object.
Definition NMBase.cpp:543
virtual const std::string & getId() const
Definition NMBase.cpp:220
virtual bool hasRequiredAttributes() const
Definition NMBase.cpp:2266
NMBase * getAncestorOfType(NUMLTypeCode_t type)
Returns the ancestor NUML object that corresponds to the given NUMLTypeCode_t.
Definition NMBase.cpp:492
unsigned int mColumn
Definition NMBase.h:900
std::string mName
Definition NMBase.h:886
int setNotes(const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *notes)
void checkNUMLListPopulated(NMBase *object)
Checks that an NUML NUMLList element has been populated.
Definition NMBase.cpp:2207
virtual void writeElements(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream &stream) const
Subclasses should override this method to write out their contained NUML objects as XML elements.
Definition NMBase.cpp:1694
void checkDefaultNamespace(const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces *xmlns, const std::string &elementName)
Checks that the given default namespace in the given element is valid.
Definition NMBase.cpp:2240
NUMLConstructorException()
elements permitted on the body element of xhtml
Definition NMBase.cpp:60
This represents the numl document that contains all information.
Definition NUMLDocument.h:107
the error log containing all errors / warnings encountered
Definition NUMLErrorLog.h:39
namespace class
Definition NUMLNamespaces.h:47
Implementation of the Visitor design pattern, for operations on NUML objects.
Definition NUMLVisitor.h:73
#define BEGIN_C_DECLS
Definition extern.h:112
#define LIBNUML_EXTERN
Begin svn Header.
Definition extern.h:104
#define END_C_DECLS
Definition extern.h:113
CLASS_OR_STRUCT NUMLDocument NUMLDocument_t
This represents the numl document that contains all information.
Definition numlfwd.h:88
CLASS_OR_STRUCT NMBase NMBase_t
This is the base class for all numl objects.
Definition numlfwd.h:82
CLASS_OR_STRUCT XMLNamespaces XMLNamespaces_t
Definition numlfwd.h:247
CLASS_OR_STRUCT XMLNode XMLNode_t
Definition numlfwd.h:235