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

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

#include <CaContent.h>

+ Inheritance diagram for CaContent:

Public Member Functions

 CaContent ()
 Creates a new CaContent instance. More...
 
 CaContent (CaNamespaces *omexns)
 Creates a new CaContent using the given CaNamespaces object omexns. More...
 
 CaContent (const CaContent &orig)
 Copy constructor for CaContent. More...
 
CaContentoperator= (const CaContent &rhs)
 Assignment operator for CaContent. More...
 
virtual CaContentclone () const
 Creates and returns a deep copy of this CaContent object. More...
 
virtual ~CaContent ()
 Destructor for CaContent. More...
 
const std::string & getLocation () const
 Returns the value of the "location" attribute of this CaContent. More...
 
const std::string & getFormat () const
 Returns the value of the "format" attribute of this CaContent. More...
 
bool isFormat (const std::string &formatKey) const
 tests whether this element is of a specific format More...
 
bool getMaster () const
 Returns the value of the "master" attribute of this CaContent. More...
 
bool isSetLocation () const
 Predicate returning true if this CaContent's "location" attribute is set. More...
 
bool isSetFormat () const
 Predicate returning true if this CaContent's "format" attribute is set. More...
 
bool isSetMaster () const
 Predicate returning true if this CaContent's "master" attribute is set. More...
 
int setLocation (const std::string &location)
 Sets the value of the "location" attribute of this CaContent. More...
 
int setFormat (const std::string &format)
 Sets the value of the "format" attribute of this CaContent. More...
 
int setMaster (bool master)
 Sets the value of the "master" attribute of this CaContent. More...
 
int unsetLocation ()
 Unsets the value of the "location" attribute of this CaContent. More...
 
int unsetFormat ()
 Unsets the value of the "format" attribute of this CaContent. More...
 
int unsetMaster ()
 Unsets the value of the "master" attribute of this CaContent. More...
 
const CaListOfCrossRefsgetListOfCrossRefs () const
 Returns the CaListOfCrossRefs from this CaContent. More...
 
CaListOfCrossRefsgetListOfCrossRefs ()
 Returns the CaListOfCrossRefs from this CaContent. More...
 
CaCrossRefgetCrossRef (unsigned int n)
 Get a CaCrossRef from the CaContent. More...
 
const CaCrossRefgetCrossRef (unsigned int n) const
 Get a CaCrossRef from the CaContent. More...
 
int addCrossRef (const CaCrossRef *ccr)
 Adds a copy of the given CaCrossRef to this CaContent. More...
 
unsigned int getNumCrossRefs () const
 Get the number of CaCrossRef objects in this CaContent. More...
 
CaCrossRefcreateCrossRef ()
 Creates a new CaCrossRef object, adds it to this CaContent object and returns the CaCrossRef object created. More...
 
CaCrossRefremoveCrossRef (unsigned int n)
 Removes the nth CaCrossRef from this CaContent and returns a pointer to it. More...
 
virtual const std::string & getElementName () const
 Returns the XML element name of this CaContent object. More...
 
virtual int getTypeCode () const
 Returns the libCombine type code for this CaContent object. More...
 
virtual bool hasRequiredAttributes () const
 Predicate returning true if all the required attributes for this CaContent object have been set. More...
 
virtual CaBasegetElementBySId (const std::string &id)
 Returns the first child element that has the given id in the model-wide SId namespace, or NULL if no such object is found. More...
 
- Public Member Functions inherited from CaBase
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...
 

Additional Inherited Members

- Protected Member Functions inherited from CaBase
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{combine} TODO:Definition of the CaContent class.

Constructor & Destructor Documentation

◆ CaContent() [1/3]

CaContent::CaContent ( )

Creates a new CaContent instance.

◆ CaContent() [2/3]

CaContent::CaContent ( CaNamespaces omexns)

Creates a new CaContent using the given CaNamespaces object omexns.

Parameters
omexnsthe CaNamespaces object.

◆ CaContent() [3/3]

CaContent::CaContent ( const CaContent orig)

Copy constructor for CaContent.

Parameters
origthe CaContent instance to copy.

◆ ~CaContent()

virtual CaContent::~CaContent ( )
virtual

Destructor for CaContent.

Member Function Documentation

◆ addCrossRef()

int CaContent::addCrossRef ( const CaCrossRef ccr)

Adds a copy of the given CaCrossRef to this CaContent.

Parameters
ccrthe CaCrossRef object to add.
  • @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t}
  • @omexconstant{LIBCOMBINE_OPERATION_FAILED, OperationReturnValues_t}
  • @omexconstant{LIBCOMBINE_INVALID_OBJECT, OperationReturnValues_t}
  • @omexconstant{LIBCOMBINE_LEVEL_MISMATCH, OperationReturnValues_t}
  • @omexconstant{LIBCOMBINE_VERSION_MISMATCH, OperationReturnValues_t}
  • @omexconstant{LIBCOMBINE_PKG_VERSION_MISMATCH, OperationReturnValues_t}
  • @omexconstant{LIBCOMBINE_DUPLICATE_OBJECT_ID, OperationReturnValues_t}
See also
createCrossRef()
getCrossRef(const std::string& sid)
getCrossRef(unsigned int n)
getNumCrossRefs()
removeCrossRef(const std::string& sid)
removeCrossRef(unsigned int n)

◆ clone()

virtual CaContent * CaContent::clone ( ) const
virtual

Creates and returns a deep copy of this CaContent object.

Returns
a (deep) copy of this CaContent object.

Implements CaBase.

◆ createCrossRef()

CaCrossRef * CaContent::createCrossRef ( )

Creates a new CaCrossRef object, adds it to this CaContent object and returns the CaCrossRef object created.

Returns
a new CaCrossRef object instance.
See also
addCrossRef(const CaCrossRef* object)
getCrossRef(const std::string& sid)
getCrossRef(unsigned int n)
getNumCrossRefs()
removeCrossRef(const std::string& sid)
removeCrossRef(unsigned int n)

◆ getCrossRef() [1/2]

CaCrossRef * CaContent::getCrossRef ( unsigned int  n)

Get a CaCrossRef from the CaContent.

Parameters
nan unsigned int representing the index of the CaCrossRef to retrieve.
Returns
the nth CaCrossRef in the CaListOfCrossRefs within this CaContent.
See also
addCrossRef(const CaCrossRef* object)
createCrossRef()
getCrossRef(const std::string& sid)
getNumCrossRefs()
removeCrossRef(const std::string& sid)
removeCrossRef(unsigned int n)

◆ getCrossRef() [2/2]

const CaCrossRef * CaContent::getCrossRef ( unsigned int  n) const

Get a CaCrossRef from the CaContent.

Parameters
nan unsigned int representing the index of the CaCrossRef to retrieve.
Returns
the nth CaCrossRef in the CaListOfCrossRefs within this CaContent.
See also
addCrossRef(const CaCrossRef* object)
createCrossRef()
getCrossRef(const std::string& sid)
getNumCrossRefs()
removeCrossRef(const std::string& sid)
removeCrossRef(unsigned int n)

◆ getElementBySId()

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

Returns the first child element that has the given id in the model-wide SId namespace, or NULL if no such object is found.

Parameters
ida string representing the id attribute of the object to retrieve.
Returns
a pointer to the CaBase element with the given id. If no such object is found, this method returns NULL.

Reimplemented from CaBase.

◆ getElementName()

virtual const std::string & CaContent::getElementName ( ) const
virtual

Returns the XML element name of this CaContent object.

For CaContent, the XML element name is always "content".

Returns
the name of this element, i.e. "content".

Implements CaBase.

◆ getFormat()

const std::string & CaContent::getFormat ( ) const

Returns the value of the "format" attribute of this CaContent.

Returns
the value of the "format" attribute of this CaContent as a string.

◆ getListOfCrossRefs() [1/2]

CaListOfCrossRefs * CaContent::getListOfCrossRefs ( )

Returns the CaListOfCrossRefs from this CaContent.

Returns
the CaListOfCrossRefs from this CaContent.
See also
addCrossRef(const CaCrossRef* object)
createCrossRef()
getCrossRef(const std::string& sid)
getCrossRef(unsigned int n)
getNumCrossRefs()
removeCrossRef(const std::string& sid)
removeCrossRef(unsigned int n)

◆ getListOfCrossRefs() [2/2]

const CaListOfCrossRefs * CaContent::getListOfCrossRefs ( ) const

Returns the CaListOfCrossRefs from this CaContent.

Returns
the CaListOfCrossRefs from this CaContent.
See also
addCrossRef(const CaCrossRef* object)
createCrossRef()
getCrossRef(const std::string& sid)
getCrossRef(unsigned int n)
getNumCrossRefs()
removeCrossRef(const std::string& sid)
removeCrossRef(unsigned int n)

◆ getLocation()

const std::string & CaContent::getLocation ( ) const

Returns the value of the "location" attribute of this CaContent.

Returns
the value of the "location" attribute of this CaContent as a string.

◆ getMaster()

bool CaContent::getMaster ( ) const

Returns the value of the "master" attribute of this CaContent.

Returns
the value of the "master" attribute of this CaContent as a boolean.

◆ getNumCrossRefs()

unsigned int CaContent::getNumCrossRefs ( ) const

Get the number of CaCrossRef objects in this CaContent.

Returns
the number of CaCrossRef objects in this CaContent.
See also
addCrossRef(const CaCrossRef* object)
createCrossRef()
getCrossRef(const std::string& sid)
getCrossRef(unsigned int n)
removeCrossRef(const std::string& sid)
removeCrossRef(unsigned int n)

◆ getTypeCode()

virtual int CaContent::getTypeCode ( ) const
virtual

Returns the libCombine type code for this CaContent object.

Returns
the OMEX type code for this object: @omexconstant{LIB_COMBINE_CONTENT, CaTypeCode_t}.
See also
getElementName()

Reimplemented from CaBase.

◆ hasRequiredAttributes()

virtual bool CaContent::hasRequiredAttributes ( ) const
virtual

Predicate returning true if all the required attributes for this CaContent object have been set.

Returns
true to indicate that all the required attributes of this CaContent have been set, otherwise false is returned.
Note
The required attributes for the CaContent object are:
  • "location"
  • "format"

◆ isFormat()

bool CaContent::isFormat ( const std::string &  formatKey) const

tests whether this element is of a specific format

Parameters
formatKeya format key
Returns
true if the format is of the type formatKey, false otherwise.

◆ isSetFormat()

bool CaContent::isSetFormat ( ) const

Predicate returning true if this CaContent's "format" attribute is set.

Returns
true if this CaContent's "format" attribute has been set, otherwise false is returned.

◆ isSetLocation()

bool CaContent::isSetLocation ( ) const

Predicate returning true if this CaContent's "location" attribute is set.

Returns
true if this CaContent's "location" attribute has been set, otherwise false is returned.

◆ isSetMaster()

bool CaContent::isSetMaster ( ) const

Predicate returning true if this CaContent's "master" attribute is set.

Returns
true if this CaContent's "master" attribute has been set, otherwise false is returned.

◆ operator=()

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

Assignment operator for CaContent.

Parameters
rhsthe CaContent object whose values are to be used as the basis of the assignment.

◆ removeCrossRef()

CaCrossRef * CaContent::removeCrossRef ( unsigned int  n)

Removes the nth CaCrossRef from this CaContent and returns a pointer to it.

Parameters
nan unsigned int representing the index of the CaCrossRef to remove.
Returns
a pointer to the nth CaCrossRef in this CaContent.
See also
addCrossRef(const CaCrossRef* object)
createCrossRef()
getCrossRef(const std::string& sid)
getCrossRef(unsigned int n)
getNumCrossRefs()
removeCrossRef(const std::string& sid)

◆ setFormat()

int CaContent::setFormat ( const std::string &  format)

Sets the value of the "format" attribute of this CaContent.

Parameters
formatstd::string& value of the "format" attribute to be set.
  • @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t}

Calling this function with format = NULL or an empty string is equivalent to calling unsetFormat().

◆ setLocation()

int CaContent::setLocation ( const std::string &  location)

Sets the value of the "location" attribute of this CaContent.

Parameters
locationstd::string& value of the "location" attribute to be set.
  • @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t}

Calling this function with location = NULL or an empty string is equivalent to calling unsetLocation().

◆ setMaster()

int CaContent::setMaster ( bool  master)

Sets the value of the "master" attribute of this CaContent.

Parameters
masterbool value of the "master" attribute to be set.
  • @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t}
  • @omexconstant{LIBCOMBINE_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t}

◆ unsetFormat()

int CaContent::unsetFormat ( )

Unsets the value of the "format" attribute of this CaContent.

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

◆ unsetLocation()

int CaContent::unsetLocation ( )

Unsets the value of the "location" attribute of this CaContent.

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

◆ unsetMaster()

int CaContent::unsetMaster ( )

Unsets the value of the "master" attribute of this CaContent.

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