libCombine
C++ library for working with the COMBINE Archive format
Loading...
Searching...
No Matches
CaBase Class Referenceabstract

@sbmlbrief{} TODO:Definition of the CaBase class. More...

#include <CaBase.h>

+ Inheritance diagram for CaBase:

Public Member Functions

virtual ~CaBase ()
 Destroys this object. More...
 
CaBaseoperator= (const CaBase &rhs)
 Assignment operator for CaBase. More...
 
virtual CaBaseclone () const =0
 Creates and returns a deep copy of this CaBase object. More...
 
virtual CaBasegetElementBySId (const std::string &id)
 Returns the first child element it can find with a specific "id" attribute value, or NULL if no such object is found. More...
 
virtual const CaBasegetElementBySId (const std::string &metaid) const
 Returns the first child element it can find with a specific "id" attribute value, or NULL if no such object is found. More...
 
virtual CaBasegetElementByMetaId (const std::string &metaid)
 Returns the first child element it can find with a specific "metaid" attribute value, or NULL if no such object is found. More...
 
virtual const CaBasegetElementByMetaId (const std::string &metaid) const
 Returns the first child element it can find with a specific "metaid" attribute value, or NULL if no such object is found. More...
 
virtual List * getAllElements ()
 Returns a List of all child CaBase objects, including those nested to an arbitrary depth. More...
 
const std::string & getMetaId () const
 Returns the value of the "metaid" attribute of this object. More...
 
std::string & getMetaId ()
 Returns the value of the "metaid" attribute of this object. More...
 
virtual const std::string & getId () const
 
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * getNotes ()
 Returns the content of the "notes" subelement of this object as a tree of XMLNode objects. More...
 
const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * getNotes () const
 Returns the content of the "notes" subelement of this object as a tree of XMLNode objects. More...
 
std::string getNotesString ()
 Returns the content of the "notes" subelement of this object as a string. More...
 
std::string getNotesString () const
 Returns the content of the "notes" subelement of this object as a string. More...
 
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * getAnnotation ()
 Returns the content of the "annotation" subelement of this object as a tree of XMLNode objects. More...
 
const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * getAnnotation () const
 Returns the content of the "annotation" subelement of this object as a tree of XMLNode objects. More...
 
std::string getAnnotationString ()
 Returns the content of the "annotation" subelement of this object as a character string. More...
 
std::string getAnnotationString () const
 Returns the content of the "annotation" subelement of this object as a character string. More...
 
virtual const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * getNamespaces () const
 Returns a list of the XML Namespaces declared on the OMEX document owning this object. More...
 
virtual LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * getNamespaces ()
 Returns a list of the XML Namespaces declared on the OMEX document owning this object. More...
 
const CaOmexManifestgetCaOmexManifest () const
 Returns the CaOmexManifest object containing this object instance. More...
 
CaOmexManifestgetCaOmexManifest ()
 Returns the CaOmexManifest object containing this object instance. More...
 
CaBasegetParentCaObject ()
 Returns the parent OMEX object containing this object. More...
 
const CaBasegetParentCaObject () const
 Returns the parent OMEX object containing this object. More...
 
CaBasegetAncestorOfType (int type)
 Returns the first ancestor object that has the given OMEX type code. More...
 
const CaBasegetAncestorOfType (int type) const
 Returns the first ancestor object that has the given OMEX type code. More...
 
unsigned int getLine () const
 Returns the line number on which this object first appears in the XML representation of the OMEX document, or '0' if the object was created, not read from a file. More...
 
unsigned int getColumn () const
 Returns the column number on which this object first appears in the XML representation of the OMEX document, or '0' if the object was created, not read from a file. More...
 
bool isSetMetaId () const
 Predicate returning true if this object's "metaid" attribute is set. More...
 
virtual bool isSetId () const
 Predicate returning true if this object's "id" attribute is set. More...
 
bool isSetNotes () const
 Predicate returning true if this object's "notes" subelement exists and has content. More...
 
bool isSetAnnotation () const
 Predicate returning true if this object's "annotation" subelement exists and has content. More...
 
int setMetaId (const std::string &metaid)
 Sets the value of the meta-identifier attribute of this object. More...
 
virtual int setId (const std::string &sid)
 Sets the value of the "id" attribute of this OMEX object. More...
 
virtual int setAnnotation (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *annotation)
 Sets the value of the "annotation" subelement of this OMEX object. More...
 
virtual int setAnnotation (const std::string &annotation)
 Sets the value of the "annotation" subelement of this OMEX object. More...
 
virtual int appendAnnotation (const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *annotation)
 Appends the given annotation to the "annotation" subelement of this object. More...
 
virtual int appendAnnotation (const std::string &annotation)
 Appends the given annotation to the "annotation" subelement of this object. More...
 
int removeTopLevelAnnotationElement (const std::string elementName, const std::string elementURI="")
 Removes the top-level element within the "annotation" subelement of this OMEX object with the given name and optional URI. More...
 
int replaceTopLevelAnnotationElement (const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *annotation)
 Replaces the given top-level element within the "annotation" subelement of this OMEX object and with the annotation element supplied. More...
 
int replaceTopLevelAnnotationElement (const std::string &annotation)
 Replaces the given top-level element within the "annotation" subelement of this OMEX object and with the annotation element supplied. More...
 
int setNotes (const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *notes)
 Sets the value of the "notes" subelement of this OMEX object. More...
 
int setNotes (const std::string &notes, bool addXHTMLMarkup=false)
 Sets the value of the "notes" subelement of this OMEX object to a copy of the string notes. More...
 
int appendNotes (const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *notes)
 Appends the given notes to the "notes" subelement of this object. More...
 
int appendNotes (const std::string &notes)
 Appends the given notes to the "notes" subelement of this object. More...
 
int setNamespaces (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces *xmlns)
 Sets the namespaces relevant of this OMEX object. More...
 
int unsetMetaId ()
 Unsets the value of the "metaid" attribute of this OMEX object. More...
 
virtual int unsetId ()
 Unsets the value of the "id" attribute of this OMEX object. More...
 
int unsetNotes ()
 Unsets the value of the "notes" subelement of this OMEX object. More...
 
int unsetAnnotation ()
 Unsets the value of the "annotation" subelement of this OMEX object. More...
 
unsigned int getLevel () const
 Returns the OMEX Level of the CaOmexManifest object containing this object. More...
 
unsigned int getVersion () const
 Returns the Version within the OMEX Level of the CaOmexManifest object containing this object. More...
 
virtual int getTypeCode () const
 Returns the libCombine type code for this object. More...
 
bool hasValidLevelVersionNamespaceCombination ()
 Predicate returning true if this object's level/version and namespace values correspond to a valid OMEX specification. More...
 
virtual const std::string & getElementName () const =0
 Returns the XML element name of this object. More...
 
char * toCa ()
 Returns a string consisting of a partial OMEX corresponding to just this object. More...
 
virtual bool isSetAttribute (const std::string &attributeName) const
 
virtual int removeFromParentAndDelete ()
 Removes this object from its parent. More...
 
bool matchesCaNamespaces (const CaBase *sb)
 Returns true if this object's set of XML namespaces are the same as the given object's XML namespaces. More...
 
bool matchesCaNamespaces (const CaBase *sb) const
 Returns true if this object's set of XML namespaces are the same as the given object's XML namespaces. More...
 
bool matchesRequiredCaNamespacesForAddition (const CaBase *sb)
 Returns true if this object's set of XML namespaces are a subset of the given object's XML namespaces. More...
 
bool matchesRequiredCaNamespacesForAddition (const CaBase *sb) const
 Returns true if this object's set of XML namespaces are a subset of the given object's XML namespaces. More...
 
int setUserData (void *userData)
 Sets the user data of this element. More...
 
void * getUserData () const
 Returns the user data that has been previously set via setUserData(). More...
 
bool isSetUserData () const
 Predicate returning true or false depending on whether the user data of this element has been set. More...
 
int unsetUserData ()
 Unsets the user data of this element. More...
 
CaErrorLoggetErrorLog ()
 Returns the CaErrorLog used to log errors while reading and validating OMEX. More...
 

Protected Member Functions

bool getHasBeenDeleted () const
 
virtual void setElementText (const std::string &text)
 When overridden allows CaBase elements to use the text included in between the elements tags. More...
 

Detailed Description

@sbmlbrief{} TODO:Definition of the CaBase class.

Constructor & Destructor Documentation

◆ ~CaBase()

virtual CaBase::~CaBase ( )
virtual

Destroys this object.

Member Function Documentation

◆ appendAnnotation() [1/2]

virtual int CaBase::appendAnnotation ( const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *  annotation)
virtual

Appends the given annotation to the "annotation" subelement of this object.

Whereas the CaBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content not meant to be shown to humans. Every object derived from CaBase can have its own value for "annotation". The element's content type is XML type "any", allowing essentially arbitrary well-formed XML data content.

OMEX places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the OMEX specifications for more details.

Unlike CaBase::setAnnotation(const XMLNode* annotation) or CaBase::setAnnotation(const std::string& annotation), this method allows other annotations to be preserved when an application adds its own data.

Parameters
annotationan XML structure that is to be copied and appended to the content of the "annotation" subelement of this object
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
getAnnotationString()
isSetAnnotation()
setAnnotation(const XMLNode* annotation)
setAnnotation(const std::string& annotation)
appendAnnotation(const std::string& annotation)
unsetAnnotation()

◆ appendAnnotation() [2/2]

virtual int CaBase::appendAnnotation ( const std::string &  annotation)
virtual

Appends the given annotation to the "annotation" subelement of this object.

Whereas the CaBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content not meant to be shown to humans. Every object derived from CaBase can have its own value for "annotation". The element's content type is XML type "any", allowing essentially arbitrary well-formed XML data content.

OMEX places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the OMEX specifications for more details.

Unlike CaBase::setAnnotation(const XMLNode* annotation) or CaBase::setAnnotation(const std::string& annotation), this method allows other annotations to be preserved when an application adds its own data.

Parameters
annotationan XML string that is to be copied and appended to the content of the "annotation" subelement of this object
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
getAnnotationString()
isSetAnnotation()
setAnnotation(const XMLNode* annotation)
setAnnotation(const std::string& annotation)
appendAnnotation(const XMLNode* annotation)
unsetAnnotation()

◆ appendNotes() [1/2]

int CaBase::appendNotes ( const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *  notes)

Appends the given notes to the "notes" subelement of this object.

The content of notes is copied.

The optional OMEX element named "notes", present on every major OMEX component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type CaBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models.

The format of "notes" elements must be XHTML 1.0. To help verify the formatting of "notes" content, libCombine provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax( ); however, readers are urged to consult the appropriate OMEX specification document for the Level and Version of their model for more in-depth explanations. The OMEX Level 2 and  3 specifications have considerable detail about how "notes" element content must be structured.

Parameters
notesan XML node structure that is to appended to the content of the "notes" subelement of this object
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
getNotesString()
isSetNotes()
setNotes(const XMLNode* notes)
setNotes(const std::string& notes, bool addXHTMLMarkup)
appendNotes(const std::string& notes)
unsetNotes()
SyntaxChecker::hasExpectedXHTMLSyntax( )

◆ appendNotes() [2/2]

int CaBase::appendNotes ( const std::string &  notes)

Appends the given notes to the "notes" subelement of this object.

The content of the parameter notes is copied.

The optional OMEX element named "notes", present on every major OMEX component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type CaBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models.

The format of "notes" elements must be XHTML 1.0. To help verify the formatting of "notes" content, libCombine provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax( ); however, readers are urged to consult the appropriate OMEX specification document for the Level and Version of their model for more in-depth explanations. The OMEX Level 2 and  3 specifications have considerable detail about how "notes" element content must be structured.

Parameters
notesan XML string that is to appended to the content of the "notes" subelement of this object
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
getNotesString()
isSetNotes()
setNotes(const XMLNode* notes)
setNotes(const std::string& notes, bool addXHTMLMarkup)
appendNotes(const XMLNode* notes)
unsetNotes()
SyntaxChecker::hasExpectedXHTMLSyntax( )

◆ clone()

virtual CaBase * CaBase::clone ( ) const
pure virtual

Creates and returns a deep copy of this CaBase object.

Returns
the (deep) copy of this CaBase object.

Implemented in CaContent, CaCrossRef, CaListOf, CaListOfContents, CaListOfCrossRefs, and CaOmexManifest.

◆ getAllElements()

virtual List * CaBase::getAllElements ( )
virtual

Returns a List of all child CaBase objects, including those nested to an arbitrary depth.

Returns
a pointer to a List of pointers to all children objects.

Reimplemented in CaListOf.

◆ getAncestorOfType() [1/2]

CaBase * CaBase::getAncestorOfType ( int  type)

Returns the first ancestor object that has the given OMEX type code.

This method searches the tree of objects that are parents of this object, and returns the first one that has the given OMEX type code from the given pkgName.

Parameters
typethe OMEX type code of the object sought
Returns
the ancestor OMEX object of this OMEX object that corresponds to the given OMEX object type code , or NULL if no ancestor exists.

◆ getAncestorOfType() [2/2]

const CaBase * CaBase::getAncestorOfType ( int  type) const

Returns the first ancestor object that has the given OMEX type code.

This method searches the tree of objects that are parents of this object, and returns the first one that has the given OMEX type code from the given pkgName.

Parameters
typethe OMEX type code of the object sought
Returns
the ancestor OMEX object of this OMEX object that corresponds to the given OMEX object type code , or NULL if no ancestor exists.

◆ getAnnotation() [1/2]

LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * CaBase::getAnnotation ( )

Returns the content of the "annotation" subelement of this object as a tree of XMLNode objects.

The annotations returned by this method will be in XML form. LibCombine provides an object model and related interfaces for certain specific kinds of annotations, namely model history information and RDF content. See the ModelHistory, CVTerm and RDFAnnotationParser classes for more information about the facilities available.

Returns
the annotation of this OMEX object as a tree of XMLNode objects.
See also
getAnnotationString()
isSetAnnotation()
setAnnotation(const XMLNode* annotation)
setAnnotation(const std::string& annotation)
appendAnnotation(const XMLNode* annotation)
appendAnnotation(const std::string& annotation)
unsetAnnotation()

◆ getAnnotation() [2/2]

const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * CaBase::getAnnotation ( ) const

Returns the content of the "annotation" subelement of this object as a tree of XMLNode objects.

The annotations returned by this method will be in XML form. LibCombine provides an object model and related interfaces for certain specific kinds of annotations, namely model history information and RDF content. See the ModelHistory, CVTerm and RDFAnnotationParser classes for more information about the facilities available.

Returns
the annotation of this OMEX object as a tree of XMLNode objects.
See also
getAnnotationString()
isSetAnnotation()
setAnnotation(const XMLNode* annotation)
setAnnotation(const std::string& annotation)
appendAnnotation(const XMLNode* annotation)
appendAnnotation(const std::string& annotation)
unsetAnnotation()

◆ getAnnotationString() [1/2]

std::string CaBase::getAnnotationString ( )

Returns the content of the "annotation" subelement of this object as a character string.

The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.

Returns
the annotation of this OMEX object as a character string.
See also
getAnnotation()
isSetAnnotation()
setAnnotation(const XMLNode* annotation)
setAnnotation(const std::string& annotation)
appendAnnotation(const XMLNode* annotation)
appendAnnotation(const std::string& annotation)
unsetAnnotation()

◆ getAnnotationString() [2/2]

std::string CaBase::getAnnotationString ( ) const

Returns the content of the "annotation" subelement of this object as a character string.

The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.

Returns
the annotation of this OMEX object as a character string.
See also
getAnnotation()
isSetAnnotation()
setAnnotation(const XMLNode* annotation)
setAnnotation(const std::string& annotation)
appendAnnotation(const XMLNode* annotation)
appendAnnotation(const std::string& annotation)
unsetAnnotation()

◆ getCaOmexManifest() [1/2]

CaOmexManifest * CaBase::getCaOmexManifest ( )

Returns the CaOmexManifest object containing this object instance.

This method allows the caller to obtain the CaOmexManifest for the current object.

Returns
the parent CaOmexManifest object of this OMEX object.
See also
getParentCaObject()
getModel()

◆ getCaOmexManifest() [2/2]

const CaOmexManifest * CaBase::getCaOmexManifest ( ) const

Returns the CaOmexManifest object containing this object instance.

This method allows the caller to obtain the CaOmexManifest for the current object.

Returns
the parent CaOmexManifest object of this OMEX object.
See also
getParentCaObject()
getModel()

◆ getColumn()

unsigned int CaBase::getColumn ( ) const

Returns the column number on which this object first appears in the XML representation of the OMEX document, or '0' if the object was created, not read from a file.

Returns
the column number of this OMEX object, or '0' if no such value.
Note
The column number for each construct in an OMEX model is set upon reading the model. The accuracy of the column number depends on the correctness of the XML representation of the model, and on the particular XML parser library being used. The former limitation relates to the following problem: if the model is actually invalid XML, then the parser may not be able to interpret the data correctly and consequently may not be able to establish the real column number. The latter limitation is simply that different parsers seem to have their own accuracy limitations, and out of all the parsers supported by libCombine, none have been 100% accurate in all situations. (At this time, libCombine supports the use of libxml2, Expat and Xerces.)
See also
getLine()

◆ getElementByMetaId() [1/2]

virtual CaBase * CaBase::getElementByMetaId ( const std::string &  metaid)
virtual

Returns the first child element it can find with a specific "metaid" attribute value, or NULL if no such object is found.

Parameters
metaidstring representing the "metaid" attribute value of the object to find.
Returns
pointer to the first element found with the given meta-identifier.

Reimplemented in CaListOf.

◆ getElementByMetaId() [2/2]

virtual const CaBase * CaBase::getElementByMetaId ( const std::string &  metaid) const
virtual

Returns the first child element it can find with a specific "metaid" attribute value, or NULL if no such object is found.

Parameters
metaidstring representing the "metaid" attribute value of the object to find.
Returns
pointer to the first element found with the given meta-identifier.

◆ getElementBySId() [1/2]

virtual CaBase * CaBase::getElementBySId ( const std::string &  id)
virtual

Returns the first child element it can find with a specific "id" attribute value, or NULL if no such object is found.

Parameters
idstring representing the "id" attribute value of the object to find.
Returns
pointer to the first element found with the given identifier.

Reimplemented in CaContent, CaListOf, and CaOmexManifest.

◆ getElementBySId() [2/2]

virtual const CaBase * CaBase::getElementBySId ( const std::string &  metaid) const
virtual

Returns the first child element it can find with a specific "id" attribute value, or NULL if no such object is found.

Parameters
idstring representing the "id" attribute value of the object to find.
Returns
pointer to the first element found with the given identifier.

◆ getElementName()

virtual const std::string & CaBase::getElementName ( ) const
pure virtual

Returns the XML element name of this object.

This is overridden by subclasses to return a string appropriate to the OMEX component. For example, Model defines it as returning "model", CompartmentType defines it as returning "compartmentType", and so on.

Implemented in CaContent, CaCrossRef, CaListOf, CaListOfContents, CaListOfCrossRefs, and CaOmexManifest.

◆ getErrorLog()

CaErrorLog * CaBase::getErrorLog ( )

Returns the CaErrorLog used to log errors while reading and validating OMEX.

Returns
the CaErrorLog used to log errors while reading and validating OMEX.

◆ getLevel()

unsigned int CaBase::getLevel ( ) const

Returns the OMEX Level of the CaOmexManifest object containing this object.

Returns
the OMEX level of this OMEX object.
See also
getVersion()
getNamespaces()
getPackageVersion()

◆ getLine()

unsigned int CaBase::getLine ( ) const

Returns the line number on which this object first appears in the XML representation of the OMEX document, or '0' if the object was created, not read from a file.

Returns
the line number of this OMEX object, or '0' if no such value.
Note
The line number for each construct in an OMEX model is set upon reading the model. The accuracy of the line number depends on the correctness of the XML representation of the model, and on the particular XML parser library being used. The former limitation relates to the following problem: if the model is actually invalid XML, then the parser may not be able to interpret the data correctly and consequently may not be able to establish the real line number. The latter limitation is simply that different parsers seem to have their own accuracy limitations, and out of all the parsers supported by libCombine, none have been 100% accurate in all situations. (At this time, libCombine supports the use of libxml2, Expat and Xerces.)
See also
getColumn()

◆ getMetaId() [1/2]

std::string & CaBase::getMetaId ( )

Returns the value of the "metaid" attribute of this object.

Returns
the meta-identifier of this OMEX object, as a string.
See also
isSetMetaId()
setMetaId(const std::string& metaid)

◆ getMetaId() [2/2]

const std::string & CaBase::getMetaId ( ) const

Returns the value of the "metaid" attribute of this object.

Returns
the meta-identifier of this OMEX object.
See also
isSetMetaId()
setMetaId(const std::string& metaid)

◆ getNamespaces() [1/2]

virtual LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * CaBase::getNamespaces ( )
virtual

Returns a list of the XML Namespaces declared on the OMEX document owning this object.

The CaNamespaces object encapsulates OMEX Level/Version/namespaces information. It is used to communicate the OMEX Level, Version, and (in Level 3) packages used in addition to OMEX Level 3 Core.

Returns
the XML Namespaces associated with this OMEX object, or NULL in certain very usual circumstances where a namespace is not set.
See also
getLevel()
getVersion()

Reimplemented in CaOmexManifest.

◆ getNamespaces() [2/2]

virtual const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * CaBase::getNamespaces ( ) const
virtual

Returns a list of the XML Namespaces declared on the OMEX document owning this object.

The CaNamespaces object encapsulates OMEX Level/Version/namespaces information. It is used to communicate the OMEX Level, Version, and (in Level 3) packages used in addition to OMEX Level 3 Core.

Returns
the XML Namespaces associated with this OMEX object, or NULL in certain very usual circumstances where a namespace is not set.
See also
getLevel()
getVersion()

Reimplemented in CaOmexManifest.

◆ getNotes() [1/2]

LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * CaBase::getNotes ( )

Returns the content of the "notes" subelement of this object as a tree of XMLNode objects.

The "notes" element content returned by this method will be in XML form, but libCombine does not provide an object model specifically for the content of notes. Callers will need to traverse the XML tree structure using the facilities available on XMLNode and related objects. For an alternative method of accessing the notes, see getNotesString().

Returns
the content of the "notes" subelement of this OMEX object as a tree structure composed of XMLNode objects.
See also
getNotesString()
isSetNotes()
setNotes(const XMLNode* notes)
setNotes(const std::string& notes)
appendNotes(const XMLNode* notes)
appendNotes(const std::string& notes)
unsetNotes()
SyntaxChecker::hasExpectedXHTMLSyntax( )

◆ getNotes() [2/2]

const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * CaBase::getNotes ( ) const

Returns the content of the "notes" subelement of this object as a tree of XMLNode objects.

The "notes" element content returned by this method will be in XML form, but libCombine does not provide an object model specifically for the content of notes. Callers will need to traverse the XML tree structure using the facilities available on XMLNode and related objects. For an alternative method of accessing the notes, see getNotesString().

Returns
the content of the "notes" subelement of this OMEX object as a tree structure composed of XMLNode objects.
See also
getNotesString()
isSetNotes()
setNotes(const XMLNode* notes)
setNotes(const std::string& notes)
appendNotes(const XMLNode* notes)
appendNotes(const std::string& notes)
unsetNotes()
SyntaxChecker::hasExpectedXHTMLSyntax( )

◆ getNotesString() [1/2]

std::string CaBase::getNotesString ( )

Returns the content of the "notes" subelement of this object as a string.

For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.

Returns
the content of the "notes" subelement of this OMEX object as a string.
See also
getNotes()
isSetNotes()
setNotes(const XMLNode* notes)
setNotes(const std::string& notes)
appendNotes(const XMLNode* notes)
appendNotes(const std::string& notes)
unsetNotes()
SyntaxChecker::hasExpectedXHTMLSyntax( )

◆ getNotesString() [2/2]

std::string CaBase::getNotesString ( ) const

Returns the content of the "notes" subelement of this object as a string.

For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.

Returns
the content of the "notes" subelement of this OMEX object as a string.
See also
getNotes()
isSetNotes()
setNotes(const XMLNode* notes)
setNotes(const std::string& notes)
appendNotes(const XMLNode* notes)
appendNotes(const std::string& notes)
unsetNotes()
SyntaxChecker::hasExpectedXHTMLSyntax( )

◆ getParentCaObject() [1/2]

CaBase * CaBase::getParentCaObject ( )

Returns the parent OMEX object containing this object.

This returns the immediately-containing object. This method is convenient when holding an object nested inside other objects in an OMEX model.

Returns
the parent OMEX object of this OMEX object.
See also
getCaOmexManifest()
getModel()

◆ getParentCaObject() [2/2]

const CaBase * CaBase::getParentCaObject ( ) const

Returns the parent OMEX object containing this object.

This returns the immediately-containing object. This method is convenient when holding an object nested inside other objects in an OMEX model.

Returns
the parent OMEX object of this OMEX object.
See also
getCaOmexManifest()
getModel()

◆ getTypeCode()

virtual int CaBase::getTypeCode ( ) const
virtual

Returns the libCombine type code for this object.

Returns
the OMEX object type code of this OMEX object, or @omexconstant{OMEX_UNKNOWN, CaTypeCode_t} (the default). The latter is possible because subclasses of CaBase are not required to implement this method to return a type code.
See also
getPackageName()
getElementName()

Reimplemented in CaContent, CaCrossRef, CaListOf, CaListOfContents, CaListOfCrossRefs, and CaOmexManifest.

◆ getUserData()

void * CaBase::getUserData ( ) const

Returns the user data that has been previously set via setUserData().

Returns
the user data of this node, or NULL if no user data has been set.

◆ getVersion()

unsigned int CaBase::getVersion ( ) const

Returns the Version within the OMEX Level of the CaOmexManifest object containing this object.

Returns
the OMEX version of this OMEX object.
See also
getLevel()
getNamespaces()

◆ hasValidLevelVersionNamespaceCombination()

bool CaBase::hasValidLevelVersionNamespaceCombination ( )

Predicate returning true if this object's level/version and namespace values correspond to a valid OMEX specification.

Returns
true if the level, version and namespace values of this OMEX object correspond to a valid set of values, false otherwise.

◆ isSetAnnotation()

bool CaBase::isSetAnnotation ( ) const

Predicate returning true if this object's "annotation" subelement exists and has content.

Whereas the CaBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content not meant to be shown to humans. Every object derived from CaBase can have its own value for "annotation". The element's content type is XML type "any", allowing essentially arbitrary well-formed XML data content.

OMEX places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the OMEX specifications for more details.

Returns
true if a "annotation" subelement exists, false otherwise.
See also
getAnnotation()
getAnnotationString()
setAnnotation(const XMLNode* annotation)
setAnnotation(const std::string& annotation)
appendAnnotation(const XMLNode* annotation)
appendAnnotation(const std::string& annotation)
unsetAnnotation()

◆ isSetId()

virtual bool CaBase::isSetId ( ) const
virtual

Predicate returning true if this object's "id" attribute is set.

Returns
true if the "id" attribute of this OMEX object is set, false otherwise.
See also
getId()

◆ isSetMetaId()

bool CaBase::isSetMetaId ( ) const

Predicate returning true if this object's "metaid" attribute is set.

Returns
true if the "metaid" attribute of this OMEX object is set, false otherwise.
See also
getMetaId()
setMetaId(const std::string& metaid)

◆ isSetNotes()

bool CaBase::isSetNotes ( ) const

Predicate returning true if this object's "notes" subelement exists and has content.

The optional OMEX element named "notes", present on every major OMEX component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type CaBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models.

The format of "notes" elements must be XHTML 1.0. To help verify the formatting of "notes" content, libCombine provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax( ); however, readers are urged to consult the appropriate OMEX specification document for the Level and Version of their model for more in-depth explanations. The OMEX Level 2 and  3 specifications have considerable detail about how "notes" element content must be structured.

Returns
true if a "notes" subelement exists, false otherwise.
See also
getNotes()
getNotesString()
setNotes(const XMLNode* notes)
setNotes(const std::string& notes)
appendNotes(const XMLNode* notes)
appendNotes(const std::string& notes)
unsetNotes()
SyntaxChecker::hasExpectedXHTMLSyntax( )

◆ isSetUserData()

bool CaBase::isSetUserData ( ) const

Predicate returning true or false depending on whether the user data of this element has been set.

Returns
boolean, true if this object's user data has been set, false otherwise.

◆ matchesCaNamespaces() [1/2]

bool CaBase::matchesCaNamespaces ( const CaBase sb)

Returns true if this object's set of XML namespaces are the same as the given object's XML namespaces.

Parameters
sban object to compare with respect to namespaces
Returns
boolean, true if this object's collection of namespaces is the same as sb's, false otherwise.

◆ matchesCaNamespaces() [2/2]

bool CaBase::matchesCaNamespaces ( const CaBase sb) const

Returns true if this object's set of XML namespaces are the same as the given object's XML namespaces.

Parameters
sban object to compare with respect to namespaces
Returns
boolean, true if this object's collection of namespaces is the same as sb's, false otherwise.

◆ matchesRequiredCaNamespacesForAddition() [1/2]

bool CaBase::matchesRequiredCaNamespacesForAddition ( const CaBase sb)

Returns true if this object's set of XML namespaces are a subset of the given object's XML namespaces.

Parameters
sban object to compare with respect to namespaces
Returns
boolean, true if this object's collection of namespaces is a subset of sb's, false otherwise.

◆ matchesRequiredCaNamespacesForAddition() [2/2]

bool CaBase::matchesRequiredCaNamespacesForAddition ( const CaBase sb) const

Returns true if this object's set of XML namespaces are a subset of the given object's XML namespaces.

Parameters
sban object to compare with respect to namespaces
Returns
boolean, true if this object's collection of namespaces is a subset of sb's, false otherwise.

◆ operator=()

CaBase & CaBase::operator= ( const CaBase rhs)

Assignment operator for CaBase.

Parameters
rhsThe object whose values are used as the basis of the assignment.

◆ removeFromParentAndDelete()

virtual int CaBase::removeFromParentAndDelete ( )
virtual

Removes this object from its parent.

If the parent was storing this object as a pointer, it is deleted. If not, it is simply cleared (as in CaListOf objects). This is a pure virtual method, as every CaBase element has different parents, and therefore different methods of removing itself. Will fail (and not delete itself) if it has no parent object. This function is designed to be overridden, but for all objects whose parent is of the class CaListOf, the default implementation will work.

  • @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t}
  • @omexconstant{LIBCOMBINE_OPERATION_FAILED, OperationReturnValues_t}

Reimplemented in CaListOf.

◆ removeTopLevelAnnotationElement()

int CaBase::removeTopLevelAnnotationElement ( const std::string  elementName,
const std::string  elementURI = "" 
)

Removes the top-level element within the "annotation" subelement of this OMEX object with the given name and optional URI.

OMEX places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the OMEX specifications for more details.

Calling this method allows a particular annotation element to be removed whilst the remaining annotations remain intact.

Parameters
elementNamea string representing the name of the top level annotation element that is to be removed
elementURIan optional string that is used to check both the name and URI of the top level element to be removed
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
replaceTopLevelAnnotationElement(const XMLNode *)
replaceTopLevelAnnotationElement(const std::string&)

◆ replaceTopLevelAnnotationElement() [1/2]

int CaBase::replaceTopLevelAnnotationElement ( const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *  annotation)

Replaces the given top-level element within the "annotation" subelement of this OMEX object and with the annotation element supplied.

OMEX places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the OMEX specifications for more details.

This method determines the name of the element to be replaced from the annotation argument. Functionally it is equivalent to calling removeTopLevelAnnotationElement(name); appendAnnotation(annotation_with_name); with the exception that the placement of the annotation element remains the same.

Parameters
annotationXMLNode representing the replacement top level annotation
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
removeTopLevelAnnotationElement(const std::string elementName, const std::string elementURI)
replaceTopLevelAnnotationElement(const std::string&)

◆ replaceTopLevelAnnotationElement() [2/2]

int CaBase::replaceTopLevelAnnotationElement ( const std::string &  annotation)

Replaces the given top-level element within the "annotation" subelement of this OMEX object and with the annotation element supplied.

OMEX places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the OMEX specifications for more details.

This method determines the name of the element to be replaced from the annotation argument. Functionally it is equivalent to calling removeTopLevelAnnotationElement(name); appendAnnotation(annotation_with_name); with the exception that the placement of the annotation element remains the same.

Parameters
annotationstring representing the replacement top level annotation
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
removeTopLevelAnnotationElement(const std::string elementName, const std::string elementURI)
replaceTopLevelAnnotationElement(const XMLNode*)

◆ setAnnotation() [1/2]

virtual int CaBase::setAnnotation ( const std::string &  annotation)
virtual

Sets the value of the "annotation" subelement of this OMEX object.

The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.

Whereas the CaBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content not meant to be shown to humans. Every object derived from CaBase can have its own value for "annotation". The element's content type is XML type "any", allowing essentially arbitrary well-formed XML data content.

OMEX places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the OMEX specifications for more details.

Call this method will result in any existing content of the "annotation" subelement to be discarded. Unless you have taken steps to first copy and reconstitute any existing annotations into the annotation that is about to be assigned, it is likely that performing such wholesale replacement is unfriendly towards other software applications whose annotations are discarded. An alternative may be to use CaBase::appendAnnotation(const XMLNode* annotation) or CaBase::appendAnnotation(const std::string& annotation).

Parameters
annotationan XML string that is to be used as the content of the "annotation" subelement of this object
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
getAnnotationString()
isSetAnnotation()
setAnnotation(const XMLNode* annotation)
appendAnnotation(const XMLNode* annotation)
appendAnnotation(const std::string& annotation)
unsetAnnotation()

◆ setAnnotation() [2/2]

virtual int CaBase::setAnnotation ( LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *  annotation)
virtual

Sets the value of the "annotation" subelement of this OMEX object.

The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.

Whereas the CaBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content not meant to be shown to humans. Every object derived from CaBase can have its own value for "annotation". The element's content type is XML type "any", allowing essentially arbitrary well-formed XML data content.

OMEX places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the OMEX specifications for more details.

Call this method will result in any existing content of the "annotation" subelement to be discarded. Unless you have taken steps to first copy and reconstitute any existing annotations into the annotation that is about to be assigned, it is likely that performing such wholesale replacement is unfriendly towards other software applications whose annotations are discarded. An alternative may be to use CaBase::appendAnnotation(const XMLNode* annotation) or CaBase::appendAnnotation(const std::string& annotation).

Parameters
annotationan XML structure that is to be used as the new content of the "annotation" subelement of this object
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
getAnnotationString()
isSetAnnotation()
setAnnotation(const std::string& annotation)
appendAnnotation(const XMLNode* annotation)
appendAnnotation(const std::string& annotation)
unsetAnnotation()

◆ setElementText()

virtual void CaBase::setElementText ( const std::string &  text)
protectedvirtual

When overridden allows CaBase elements to use the text included in between the elements tags.

The default implementation does nothing.

Parameters
textthe text string found between the element tags.

◆ setId()

virtual int CaBase::setId ( const std::string &  sid)
virtual

Sets the value of the "id" attribute of this OMEX object.

◆ setMetaId()

int CaBase::setMetaId ( const std::string &  metaid)

Sets the value of the meta-identifier attribute of this object.

The string metaid is copied.

Parameters
metaidthe identifier string to use as the value of the "metaid" attribute
  • @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t}
  • @omexconstant{LIBCOMBINE_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t}
  • @omexconstant{LIBCOMBINE_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
See also
getMetaId()
isSetMetaId()

◆ setNamespaces()

int CaBase::setNamespaces ( LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces *  xmlns)

Sets the namespaces relevant of this OMEX object.

The content of xmlns is copied, and this object's existing namespace content is deleted.

The CaNamespaces object encapsulates OMEX Level/Version/namespaces information. It is used to communicate the OMEX Level, Version, and (in Level 3) packages used in addition to OMEX Level 3 Core.

Parameters
xmlnsthe namespaces to set
  • @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t}

◆ setNotes() [1/2]

int CaBase::setNotes ( const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *  notes)

Sets the value of the "notes" subelement of this OMEX object.

The content of notes is copied, and any existing content of this object's "notes" subelement is deleted.

The optional OMEX element named "notes", present on every major OMEX component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type CaBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models.

The format of "notes" elements must be XHTML 1.0. To help verify the formatting of "notes" content, libCombine provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax( ); however, readers are urged to consult the appropriate OMEX specification document for the Level and Version of their model for more in-depth explanations. The OMEX Level 2 and  3 specifications have considerable detail about how "notes" element content must be structured.

Parameters
notesan XML structure that is to be used as the content of the "notes" subelement of this object
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
getNotesString()
isSetNotes()
setNotes(const std::string& notes, bool addXHTMLMarkup)
appendNotes(const XMLNode* notes)
appendNotes(const std::string& notes)
unsetNotes()
SyntaxChecker::hasExpectedXHTMLSyntax( )

◆ setNotes() [2/2]

int CaBase::setNotes ( const std::string &  notes,
bool  addXHTMLMarkup = false 
)

Sets the value of the "notes" subelement of this OMEX object to a copy of the string notes.

The content of notes is copied, and any existing content of this object's "notes" subelement is deleted.

The optional OMEX element named "notes", present on every major OMEX component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type CaBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models.

The format of "notes" elements must be XHTML 1.0. To help verify the formatting of "notes" content, libCombine provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax( ); however, readers are urged to consult the appropriate OMEX specification document for the Level and Version of their model for more in-depth explanations. The OMEX Level 2 and  3 specifications have considerable detail about how "notes" element content must be structured.

Parameters
notesan XML string that is to be used as the content of the "notes" subelement of this object
addXHTMLMarkupa boolean indicating whether to wrap the contents of the notes argument with XHTML paragraph (<p>) tags. This is appropriate when the string in notes does not already containg the appropriate XHTML markup.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
getNotesString()
isSetNotes()
setNotes(const XMLNode* notes)
appendNotes(const XMLNode* notes)
appendNotes(const std::string& notes)
unsetNotes()
SyntaxChecker::hasExpectedXHTMLSyntax( )

◆ setUserData()

int CaBase::setUserData ( void *  userData)

Sets the user data of this element.

Parameters
userDataspecifies the new user data.
  • @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t}
  • @omexconstant{LIBCOMBINE_OPERATION_FAILED, OperationReturnValues_t}

◆ toCa()

char * CaBase::toCa ( )

Returns a string consisting of a partial OMEX corresponding to just this object.

Returns
the partial OMEX that describes this OMEX object.
Warning
This is primarily provided for testing and debugging purposes. It may be removed in a future version of libCombine.

◆ unsetAnnotation()

int CaBase::unsetAnnotation ( )

Unsets the value of the "annotation" subelement of this OMEX object.

Whereas the CaBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content not meant to be shown to humans. Every object derived from CaBase can have its own value for "annotation". The element's content type is XML type "any", allowing essentially arbitrary well-formed XML data content.

OMEX places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the OMEX specifications for more details.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
getAnnotation()
getAnnotationString()
isSetAnnotation()
setAnnotation(const XMLNode* annotation)
setAnnotation(const std::string& annotation)
appendAnnotation(const XMLNode* annotation)
appendAnnotation(const std::string& annotation)

◆ unsetId()

virtual int CaBase::unsetId ( )
virtual

Unsets the value of the "id" attribute of this OMEX object.

◆ unsetMetaId()

int CaBase::unsetMetaId ( )

Unsets the value of the "metaid" attribute of this OMEX object.

◆ unsetNotes()

int CaBase::unsetNotes ( )

Unsets the value of the "notes" subelement of this OMEX object.

The optional OMEX element named "notes", present on every major OMEX component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type CaBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models.

The format of "notes" elements must be XHTML 1.0. To help verify the formatting of "notes" content, libCombine provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax( ); however, readers are urged to consult the appropriate OMEX specification document for the Level and Version of their model for more in-depth explanations. The OMEX Level 2 and  3 specifications have considerable detail about how "notes" element content must be structured.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
getNotesString()
isSetNotes()
setNotes(const XMLNode* notes)
setNotes(const std::string& notes, bool addXHTMLMarkup)
appendNotes(const XMLNode* notes)
appendNotes(const std::string& notes)
SyntaxChecker::hasExpectedXHTMLSyntax( )

◆ unsetUserData()

int CaBase::unsetUserData ( )

Unsets the user data of this element.

  • @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t}
  • @omexconstant{LIBCOMBINE_OPERATION_FAILED, OperationReturnValues_t}