libNuML 1.1.1
Library for reading / writing NuML documents
|
this class stores the component descriptions More...
#include <CompositeDescription.h>
Public Member Functions | |
CompositeDescription () | |
~CompositeDescription () | |
CompositeDescription (unsigned int level, unsigned int version) | |
Creates a new CompositeDescription using the given NUML level and version values. | |
CompositeDescription (NUMLNamespaces *numlns) | |
Creates a new CompositeDescription using the given NUMLNamespaces object numlns . | |
virtual CompositeDescription * | clone () const |
Creates and returns a deep copy of this CompositeDescription instance. | |
virtual bool | accept (NUMLVisitor &v) const |
Accepts the given NUMLVisitor for this instance of Dimension. | |
virtual const std::string & | getName () const |
Returns the value of the "name" attribute of this CompositeDescription. | |
virtual const std::string & | getId () const |
virtual int | setId (const std::string &id) |
const std::string & | getIndexType () const |
Returns the value of the "indexType" attribute of this CompositeDescription. | |
bool | isContentCompositeDescription () const |
Predicate returning true or false depending on whether this CompositeDescription object's content is another CompositeDescription object. | |
bool | isContentTupleDescription () const |
Predicate returning true or false depending on whether this CompositeDescription object's content is TupleDescription object. | |
bool | isContentAtomicDescription () const |
Predicate returning true or false depending on whether this CompositeDescription object's content is AtomicDescription object. | |
const std::string & | getOntologyTerm () const |
Returns the value of the "ontologyTerm" attribute of this CompositeDescription. | |
virtual int | setName (const std::string &name) |
Sets the value of the "name" attribute of this NUML object. | |
int | setIndexType (const std::string &indexType) |
Sets the value of the "indexType" attribute of this NUML object. | |
int | setOntologyTerm (const std::string &ontologyTerm) |
Sets the value of the "ontologyTerm" attribute of this NUML object. | |
virtual const std::string & | getElementName () const |
Returns the XML element name of this object, which for CompositeDescription, is always "CompositeDescription" . | |
virtual NUMLTypeCode_t | getTypeCode () const |
Returns the libNUML type code for this NUML object. | |
virtual NUMLTypeCode_t | getItemTypeCode () const |
Returns the libNUML type code for the objects contained in this NUMLList (i.e., CompositeDescription objects, if the list is non-empty). | |
CompositeDescription * | getCompositeDescription (unsigned int n) |
Get a CompositeDescription from the CompositeDescription. | |
TupleDescription * | getTupleDescription () |
Get a TupleDescription from the CompositeDescription. | |
AtomicDescription * | getAtomicDescription () |
Get AtomicDescription from the CompositeDescription. | |
virtual CompositeDescription * | get (unsigned int n) |
Get a CompositeDescription from the CompositeDescription. | |
virtual const CompositeDescription * | get (unsigned int n) const |
Get a CompositeDescription from the CompositeDescription. | |
virtual CompositeDescription * | remove (unsigned int n) |
Removes the nth item from this CompositeDescription items and returns a pointer to it. | |
CompositeDescription * | createCompositeDescription () |
Creates a new CompositeDescription object inside this CompositeDescription add to it's List and return it. | |
TupleDescription * | createTupleDescription () |
Creates a new TupleDescription inside this CompositeDescription and return it. | |
AtomicDescription * | createAtomicDescription () |
Creates a new AtomicDescription to this CompositeDescription and returns it. | |
![]() | |
DimensionDescription () | |
DimensionDescription (unsigned int level, unsigned int version) | |
Creates a new DimensionDescription using the given NUML level and version values. | |
DimensionDescription (NUMLNamespaces *numlns) | |
Creates a new DimensionDescription using the given NUMLNamespaces object numlns . | |
CompositeDescription * | createCompositeDescription () |
Returns a list of the XML Namespaces declared on this NUML document. | |
TupleDescription * | createTupleDescription () |
creates a new tupledescription and adds it to the dimensiondescription | |
AtomicDescription * | createAtomicDescription () |
creates a new atomic description and adds it to the dimensiondescription | |
virtual DimensionDescription * | get (const std::string &sid) |
Get a CompositeDescription from the DimensionDescription based on its identifier. | |
virtual const DimensionDescription * | get (const std::string &sid) const |
Get a CompositeDescription from the DimensionDescription based on its identifier. | |
virtual DimensionDescription * | remove (const std::string &sid) |
Removes item in this DimensionDescription items with the given identifier. | |
virtual int | getElementPosition () const |
Get the ordinal position of this element in the containing object (which in this case is the Model object). | |
virtual | ~DimensionDescription () |
![]() | |
NUMLList (unsigned int level, unsigned int version) | |
Creates a new NUMLList using the given NUML level and version values. | |
NUMLList (NUMLNamespaces *numlns) | |
Creates a new DimensionDescription using the given NUMLNamespaces object numlns . | |
NUMLList () | |
virtual | ~NUMLList () |
NUMLList (const NUMLList &orig) | |
Copy constructor. | |
NUMLList & | operator= (const NUMLList &rhs) |
Assignment operator for NUMLList. | |
void | append (const NMBase *item) |
Adds item to the end of this NUMLList. | |
void | appendAndOwn (NMBase *item) |
Adds item to the end of this NUMLList. | |
void | clear (bool doDelete=true) |
Removes all items in this NUMLList object. | |
unsigned int | size () const |
Get the size of this NUMLList. | |
virtual void | setNUMLDocument (NUMLDocument *d) |
Sets the parent NUMLDocument of this NUML object. | |
virtual void | setParentNUMLObject (NMBase *sb) |
Sets the parent NUML object of this NUML object. | |
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. | |
![]() | |
virtual | ~NMBase () |
Destroy this object. | |
NMBase & | operator= (const NMBase &orig) |
Assignment operator for NMBase. | |
const std::string & | getMetaId () const |
Returns the value of the "metaid" attribute of this object. | |
std::string & | getMetaId () |
Returns the value of the "metaid" attribute of this object. | |
virtual LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * | getNamespaces () const |
Returns the content of the "annotation" subelement of this object as a character string. | |
const NUMLDocument * | getNUMLDocument () const |
Returns the parent NUMLDocument object. | |
NUMLDocument * | getNUMLDocument () |
Returns the parent NUMLDocument object. | |
NMBase * | getParentNUMLObject () |
Returns the parent NUML object. | |
NMBase * | getAncestorOfType (NUMLTypeCode_t type) |
Returns the ancestor NUML object that corresponds to the given NUMLTypeCode_t. | |
unsigned int | getLine () const |
Returns the line number on which this object first appears in the XML representation of the NUML document. | |
unsigned int | getColumn () const |
Returns the column number on which this object first appears in the XML representation of the NUML document. | |
bool | isSetMetaId () const |
Predicate returning true or false depending on whether this object's "metaid" attribute has been set. | |
bool | isSetName () const |
int | setMetaId (const std::string &metaid) |
Sets the value of the "metaid" attribute of this object. | |
int | setNamespaces (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces *xmlns) |
Sets the namespaces relevant of this NUML object. | |
int | unsetMetaId () |
Unsets the value of the "metaid" attribute of this NUML object. | |
unsigned int | getLevel () const |
Returns the NUML Level of the overall NUML document. | |
unsigned int | getVersion () const |
Returns the Version within the NUML Level of the overall NUML document. | |
bool | hasValidLevelVersionNamespaceCombination () |
Predicate returning true or false depending on whether this object's level/version and namespace values correspond to a valid NUML specification. | |
char * | toNUML () |
Returns a string that consists of the partial NUML describing this object. | |
void | read (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream) |
Reads (initializes) this NUML object by reading from XMLInputStream. | |
void | write (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream &stream) const |
Writes (serializes) this NUML object by writing it to XMLOutputStream. | |
virtual bool | hasRequiredAttributes () const |
virtual bool | hasRequiredElements () const |
void | setNUMLNamespaces (NUMLNamespaces *numlns) |
NUMLNamespaces * | getNUMLNamespaces () const |
void | syncAnnotation () |
bool | isSetNotes () const |
bool | isSetAnnotation () const |
virtual int | setAnnotation (const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *annotation) |
virtual int | setAnnotation (const std::string &annotation) |
virtual int | appendAnnotation (const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *annotation) |
virtual int | appendAnnotation (const std::string &annotation) |
int | removeTopLevelAnnotationElement (const std::string elementName, const std::string elementURI="") |
int | replaceTopLevelAnnotationElement (const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *annotation) |
int | replaceTopLevelAnnotationElement (const std::string &annotation) |
int | setNotes (const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *notes) |
int | setNotes (const std::string ¬es, bool addXHTMLMarkup=false) |
int | appendNotes (const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *notes) |
int | appendNotes (const std::string ¬es) |
int | unsetNotes () |
int | unsetAnnotation () |
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * | getNotes () const |
std::string | getNotesString () const |
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * | getAnnotation () const |
std::string | getAnnotationString () const |
Protected Member Functions | |
virtual NMBase * | createObject (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream) |
Subclasses should override this method to write out their contained NUML objects as XML elements. | |
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 specific fields. | |
virtual void | writeAttributes (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream &stream) const |
Subclasses should override this method to write their XML attributes to the XMLOutputStream. | |
![]() | |
virtual void | writeXMLNS (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream &stream) const |
Subclasses should override this method to write their xmlns attriubutes (if any) to the XMLOutputStream. | |
![]() | |
![]() | |
NMBase (const std::string &id="", const std::string &name="") | |
Only subclasses may create NMBase objects. | |
NMBase (unsigned int level, unsigned int version) | |
Creates a new NMBase object with the given sboTerm. | |
NMBase (NUMLNamespaces *numlns) | |
Creates a new NMBase object with the given NUMLNamespaces. | |
NMBase (const NMBase &orig) | |
Copy constructor. | |
virtual bool | readOtherXML (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream) |
Subclasses should override this method to read (and store) XHTML, MathML, etc. | |
NUMLErrorLog * | getErrorLog () |
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. | |
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. | |
void | logUnknownElement (const std::string element, const unsigned int level, const unsigned int version) |
Helper to log a common type of error. | |
void | logEmptyString (std::string attribute, const unsigned int level, const unsigned int version, std::string element) |
Helper to log a common type of error. | |
void | checkOrderAndLogError (NMBase *object, int expected) |
Checks that NUML element has been read in the proper order. | |
void | checkNUMLListPopulated (NMBase *object) |
Checks that an NUML NUMLList element has been populated. | |
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. | |
void | checkXHTML (const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *) |
Checks that the XHTML is valid. | |
void | checkAnnotation () |
Checks the annotation does not declare an numl namespace. | |
Protected Attributes | |
std::string | mId |
std::string | mName |
std::string | mOntologyTerm |
std::string | mIndexType |
NUMLTypeCode_t | mContentType |
![]() | |
std::string | mId |
std::string | mName |
![]() | |
std::vector< NMBase * > | mItems |
![]() | |
std::string | mMetaId |
std::string | mId |
std::string | mName |
NUMLDocument * | mNUML |
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * | mNotes |
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * | mAnnotation |
NUMLNamespaces * | mNUMLNamespaces |
unsigned int | mLine |
unsigned int | mColumn |
int | mDept |
NMBase * | mParentNUMLObject |
bool | mHasBeenDeleted |
std::string | mEmptyString |
this class stores the component descriptions
CompositeDescription::CompositeDescription | ( | ) |
CompositeDescription::~CompositeDescription | ( | ) |
LIBNUML_CPP_NAMESPACE_BEGIN CompositeDescription::CompositeDescription | ( | unsigned int | level, |
unsigned int | version ) |
Creates a new CompositeDescription using the given NUML level
and version
values.
level | an unsigned int, the NUML Level to assign to this CompositeDescription |
version | an unsigned int, the NUML Version to assign to this CompositeDescription |
level
, version
for the document override those used to create the CompositeDescription. Despite this, the ability to supply the values at creation time is an important aid to creating valid NUML. Knowledge of the intented NUML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing NUMLDocument. CompositeDescription::CompositeDescription | ( | NUMLNamespaces * | numlns | ) |
Creates a new CompositeDescription using the given NUMLNamespaces object numlns
.
The NUMLNamespaces object encapsulates NUML Level/Version/namespaces information. It is used to communicate the NUML Level, Version, and (in Level 3) packages used in addition to NUML Level Core. A common approach to using this class constructor is to create an NUMLNamespaces object somewhere in a program, once, then pass it to object constructors such as this one when needed.
numlns | an NUMLNamespaces object. |
level
, version
and xmlns
namespaces for the document override those used to create the CompositeDescription. Despite this, the ability to supply the values at creation time is an important aid to creating valid NUML. Knowledge of the intented NUML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing NUMLDocument.
|
virtual |
Accepts the given NUMLVisitor for this instance of Dimension.
v | the NUMLVisitor instance to be used. |
v.visit()
. Reimplemented from DimensionDescription.
|
virtual |
Creates and returns a deep copy of this CompositeDescription instance.
Reimplemented from DimensionDescription.
AtomicDescription * CompositeDescription::createAtomicDescription | ( | ) |
Creates a new AtomicDescription to this CompositeDescription and returns it.
CompositeDescription * CompositeDescription::createCompositeDescription | ( | ) |
Creates a new CompositeDescription object inside this CompositeDescription add to it's List and return it.
|
protectedvirtual |
Subclasses should override this method to write out their contained NUML objects as XML elements.
Be sure to call your parents implementation of this method as well.
Reimplemented from DimensionDescription.
TupleDescription * CompositeDescription::createTupleDescription | ( | ) |
Creates a new TupleDescription inside this CompositeDescription and return it.
|
virtual |
Get a CompositeDescription from the CompositeDescription.
n | the index number of the CompositeDescription to get. |
Reimplemented from DimensionDescription.
|
virtual |
Get a CompositeDescription from the CompositeDescription.
n | the index number of the CompositeDescription to get. |
Reimplemented from DimensionDescription.
AtomicDescription * CompositeDescription::getAtomicDescription | ( | ) |
Get AtomicDescription from the CompositeDescription.
CompositeDescription * CompositeDescription::getCompositeDescription | ( | unsigned int | n | ) |
Get a CompositeDescription from the CompositeDescription.
n | the index number of the CompositeDescription to get. |
|
virtual |
Returns the XML element name of this object, which for CompositeDescription, is always "CompositeDescription"
.
"compositeDescription"
. Reimplemented from DimensionDescription.
|
virtual |
Reimplemented from DimensionDescription.
const string & CompositeDescription::getIndexType | ( | ) | const |
Returns the value of the "indexType" attribute of this CompositeDescription.
|
virtual |
Returns the libNUML type code for the objects contained in this NUMLList (i.e., CompositeDescription objects, if the list is non-empty).
NUML_UNKNOWN
(default).Reimplemented from DimensionDescription.
|
virtual |
Returns the value of the "name" attribute of this CompositeDescription.
Reimplemented from DimensionDescription.
const string & CompositeDescription::getOntologyTerm | ( | ) | const |
Returns the value of the "ontologyTerm" attribute of this CompositeDescription.
TupleDescription * CompositeDescription::getTupleDescription | ( | ) |
Get a TupleDescription from the CompositeDescription.
|
inlinevirtual |
Returns the libNUML type code for this NUML object.
NUML_UNKNOWN
(default).Reimplemented from DimensionDescription.
bool CompositeDescription::isContentAtomicDescription | ( | ) | const |
Predicate returning true
or false
depending on whether this CompositeDescription object's content is AtomicDescription object.
true
if the content of this CompositeDescription object is AtomicDescription object, false
otherwise.bool CompositeDescription::isContentCompositeDescription | ( | ) | const |
Predicate returning true
or false
depending on whether this CompositeDescription object's content is another CompositeDescription object.
true
if the content of this CompositeDescription object is another CompositeDescription object, false
otherwise.bool CompositeDescription::isContentTupleDescription | ( | ) | const |
Predicate returning true
or false
depending on whether this CompositeDescription object's content is TupleDescription object.
true
if the content of this CompositeDescription object is TupleDescription object, false
otherwise.
|
protectedvirtual |
Subclasses should override this method to read values from the given XMLAttributes set into their specific fields.
Be sure to call your parents implementation of this method as well.
Reimplemented from NUMLList.
|
virtual |
Removes the nth item from this CompositeDescription items and returns a pointer to it.
The caller owns the returned item and is responsible for deleting it.
n | the index of the item to remove |
Reimplemented from DimensionDescription.
|
virtual |
Reimplemented from DimensionDescription.
int CompositeDescription::setIndexType | ( | const std::string & | indexType | ) |
Sets the value of the "indexType" attribute of this NUML object.
The string in indexType
is copied.
indexType | the new indexType for the object |
|
virtual |
Sets the value of the "name" attribute of this NUML object.
The string in name
is copied.
name | the new name for the object |
Reimplemented from DimensionDescription.
int CompositeDescription::setOntologyTerm | ( | const std::string & | ontologyTerm | ) |
Sets the value of the "ontologyTerm" attribute of this NUML object.
The string in ontologyTerm
is copied.
ontologyTerm | the new ontologyTerm for the object |
|
protectedvirtual |
Subclasses should override this method to write their XML attributes to the XMLOutputStream.
Be sure to call your parents implementation of this method as well. For example:
NMBase::writeAttributes(stream); stream.writeAttribute( "id" , mId ); stream.writeAttribute( "name", mName ); ...
Reimplemented from NUMLList.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |