libNuML
1.1.1
Library for reading / writing NuML documents
|
This class stores the composite values. More...
#include <CompositeValue.h>
Public Member Functions | |
CompositeValue () | |
~CompositeValue () | |
CompositeValue (unsigned int level, unsigned int version) | |
Creates a new CompositeValue using the given NUML level and version values. More... | |
CompositeValue (NUMLNamespaces *numlns) | |
Creates a new CompositeValue using the given NUMLNamespaces object numlns . More... | |
virtual CompositeValue * | clone () const |
Creates and returns a deep copy of this CompositeValue instance. More... | |
virtual bool | accept (NUMLVisitor &v) const |
Accepts the given NUMLVisitor for this instance of Dimension. More... | |
virtual NUMLTypeCode_t | getTypeCode () const |
Returns the libNUML type code for this NUML object. More... | |
const std::string & | getIndexValue () const |
Returns the value of the "indexValue" attribute of this CompositeValue. More... | |
const std::string & | getDescription () const |
Returns the value of the "description" attribute of this CompositeValue. More... | |
int | setIndexValue (const std::string &indexValue) |
Sets the value of the "indexValue" attribute of this NUML object. More... | |
int | setDescription (const std::string &description) |
Sets the value of the "description" attribute of this NUML object. More... | |
virtual const std::string & | getElementName () const |
Returns the XML element name of this object, which for CompositeValue, is always "compositeValue" . More... | |
virtual NUMLTypeCode_t | getItemTypeCode () const |
Returns the libNUML type code for the objects contained in this NUMLList (i.e., CompositeValue objects, if the list is non-empty). More... | |
bool | isContentCompositeValue () const |
Predicate returning true or false depending on whether this CompositeValue object's content is another CompositeValue object. More... | |
bool | isContentTuple () const |
Predicate returning true or false depending on whether this CompositeValue object's content is Tuple object. More... | |
bool | isContentAtomicValue () const |
Predicate returning true or false depending on whether this CompositeValue object's content is AtomicValue object. More... | |
CompositeValue * | getCompositeValue (unsigned int n) |
Get a CompositeValue from the CompositeValue. More... | |
Tuple * | getTuple () |
Get a Tuple from the CompositeValue. More... | |
AtomicValue * | getAtomicValue () |
Get AtomicValue from the CompositeValue. More... | |
virtual const CompositeValue * | get (unsigned int n) const |
Get a CompositeValue from the CompositeValue. More... | |
virtual CompositeValue * | get (unsigned int n) |
Get a CompositeValue from the CompositeValue. More... | |
virtual CompositeValue * | remove (unsigned int n) |
Removes the nth item from this CompositeValue items and returns a pointer to it. More... | |
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. More... | |
virtual void | writeAttributes (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream &stream) const |
Subclasses should override this method to write their XML attributes to the XMLOutputStream. More... | |
int | addCompositeValue (const CompositeValue *compValue) |
Adds a given CompositeValue object as a child in this CompositeVlaue. More... | |
CompositeValue * | createCompositeValue () |
Creates a new CompositeValue object inside this CompositeValue add to it's List and return it. More... | |
Tuple * | createTuple () |
Creates a new Tuple inside this CompositeValue and return it. More... | |
AtomicValue * | createAtomicValue () |
Creates a new AtomicValue to this CompositeValue and returns it. More... | |
![]() | |
Dimension () | |
Dimension (unsigned int level, unsigned int version) | |
Creates an new Dimension using the given NUML level and version values. More... | |
Dimension (NUMLNamespaces *numlns) | |
Creates a new Dimension using the given NUMLNamespaces object numlns . More... | |
CompositeValue * | createCompositeValue () |
Creates a new CompositeValue and add it to Dimension's list inside this ResultComponent and return it. More... | |
Tuple * | createTuple () |
creates a new tuple and adds it to the dimension More... | |
AtomicValue * | createAtomicValue () |
creates a new atomic value and adds it to the dimension More... | |
virtual CompositeValue * | get (const std::string &sid) |
Get a CompositeValue from the Dimension based on its identifier. More... | |
virtual const CompositeValue * | get (const std::string &sid) const |
Get a CompositeValue from the Dimension based on its identifier. More... | |
virtual Dimension * | remove (const std::string &sid) |
Removes item in this Dimension items with the given identifier. More... | |
virtual int | getElementPosition () const |
Get the ordinal position of this element in the containing object (which in this case is the Model object). More... | |
virtual | ~Dimension () |
Subclasses should override this method to write out their contained NUML objects as XML elements. More... | |
![]() | |
NUMLList (unsigned int level, unsigned int version) | |
Creates a new NUMLList using the given NUML level and version values. More... | |
NUMLList (NUMLNamespaces *numlns) | |
Creates a new DimensionDescription using the given NUMLNamespaces object numlns . More... | |
NUMLList () | |
virtual | ~NUMLList () |
NUMLList (const NUMLList &orig) | |
Copy constructor. More... | |
NUMLList & | operator= (const NUMLList &rhs) |
Assignment operator for NUMLList. More... | |
void | append (const NMBase *item) |
Adds item to the end of this NUMLList. More... | |
void | appendAndOwn (NMBase *item) |
Adds item to the end of this NUMLList. More... | |
void | clear (bool doDelete=true) |
Removes all items in this NUMLList object. More... | |
unsigned int | size () const |
Get the size of this NUMLList. More... | |
virtual void | setNUMLDocument (NUMLDocument *d) |
Sets the parent NUMLDocument of this NUML object. More... | |
virtual void | setParentNUMLObject (NMBase *sb) |
Sets the parent NUML object of this NUML object. More... | |
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. More... | |
![]() | |
virtual | ~NMBase () |
Destroy this object. More... | |
NMBase & | operator= (const NMBase &orig) |
Assignment operator for NMBase. 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 |
virtual const std::string & | getName () const |
virtual LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * | getNamespaces () const |
Returns the content of the "annotation" subelement of this object as a character string. More... | |
const NUMLDocument * | getNUMLDocument () const |
Returns the parent NUMLDocument object. More... | |
NUMLDocument * | getNUMLDocument () |
Returns the parent NUMLDocument object. More... | |
NMBase * | getParentNUMLObject () |
Returns the parent NUML object. More... | |
NMBase * | getAncestorOfType (NUMLTypeCode_t type) |
Returns the ancestor NUML object that corresponds to the given NUMLTypeCode_t. More... | |
unsigned int | getLine () const |
Returns the line number on which this object first appears in the XML representation of the NUML document. More... | |
unsigned int | getColumn () const |
Returns the column number on which this object first appears in the XML representation of the NUML document. More... | |
bool | isSetMetaId () const |
Predicate returning true or false depending on whether this object's "metaid" attribute has been set. More... | |
bool | isSetName () const |
int | setMetaId (const std::string &metaid) |
Sets the value of the "metaid" attribute of this object. More... | |
virtual int | setId (const std::string &sid) |
int | setNamespaces (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces *xmlns) |
Sets the namespaces relevant of this NUML object. More... | |
int | unsetMetaId () |
Unsets the value of the "metaid" attribute of this NUML object. More... | |
unsigned int | getLevel () const |
Returns the NUML Level of the overall NUML document. More... | |
unsigned int | getVersion () const |
Returns the Version within the NUML Level of the overall NUML document. More... | |
bool | hasValidLevelVersionNamespaceCombination () |
Predicate returning true or false depending on whether this object's level/version and namespace values correspond to a valid NUML specification. More... | |
char * | toNUML () |
Returns a string that consists of the partial NUML describing this object. More... | |
void | read (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream) |
Reads (initializes) this NUML object by reading from XMLInputStream. More... | |
void | write (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream &stream) const |
Writes (serializes) this NUML object by writing it to XMLOutputStream. More... | |
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. More... | |
![]() | |
void | setType (DimensionType type) |
Sets type of this Dimension. More... | |
![]() | |
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. More... | |
NMBase (const std::string &id="", const std::string &name="") | |
Only subclasses may create NMBase objects. More... | |
NMBase (unsigned int level, unsigned int version) | |
Creates a new NMBase object with the given sboTerm. More... | |
NMBase (NUMLNamespaces *numlns) | |
Creates a new NMBase object with the given NUMLNamespaces. More... | |
NMBase (const NMBase &orig) | |
Copy constructor. More... | |
virtual bool | readOtherXML (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream) |
Subclasses should override this method to read (and store) XHTML, MathML, etc. More... | |
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. More... | |
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. More... | |
void | logUnknownElement (const std::string element, const unsigned int level, const unsigned int version) |
Helper to log a common type of error. More... | |
void | logEmptyString (std::string attribute, const unsigned int level, const unsigned int version, std::string element) |
Helper to log a common type of error. More... | |
void | checkOrderAndLogError (NMBase *object, int expected) |
Checks that NUML element has been read in the proper order. More... | |
void | checkNUMLListPopulated (NMBase *object) |
Checks that an NUML NUMLList element has been populated. More... | |
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. More... | |
void | checkXHTML (const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *) |
Checks that the XHTML is valid. More... | |
void | checkAnnotation () |
Checks the annotation does not declare an numl namespace. More... | |
Protected Attributes | |
std::string | mIndexValue |
std::string | mDescription |
NUMLTypeCode_t | mContentType |
![]() | |
DimensionType | mType |
![]() | |
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 |
Additional Inherited Members | |
![]() | |
enum | DimensionType { Unknown, CompositeValueType, TupleType, AtomicValueType } |
This class stores the composite values.
CompositeValue::CompositeValue | ( | ) |
CompositeValue::~CompositeValue | ( | ) |
LIBNUML_CPP_NAMESPACE_BEGIN CompositeValue::CompositeValue | ( | unsigned int | level, |
unsigned int | version | ||
) |
Creates a new CompositeValue using the given NUML level
and version
values.
level | an unsigned int, the NUML Level to assign to this CompositeValue |
version | an unsigned int, the NUML Version to assign to this CompositeValue |
level
, version
for the document override those used to create the CompositeValue. 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. CompositeValue::CompositeValue | ( | NUMLNamespaces * | numlns | ) |
Creates a new CompositeValue 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 CompositeValue. 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 Dimension.
int CompositeValue::addCompositeValue | ( | const CompositeValue * | compValue | ) |
Adds a given CompositeValue object as a child in this CompositeVlaue.
The CompositeValue instance in compValue
is copied.
compValue | a CompositeValue object referring to a Child in the CompositeValue |
|
virtual |
Creates and returns a deep copy of this CompositeValue instance.
Reimplemented from Dimension.
AtomicValue * CompositeValue::createAtomicValue | ( | ) |
Creates a new AtomicValue to this CompositeValue and returns it.
CompositeValue * CompositeValue::createCompositeValue | ( | ) |
Creates a new CompositeValue object inside this CompositeValue 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 Dimension.
Tuple * CompositeValue::createTuple | ( | ) |
Creates a new Tuple inside this CompositeValue and return it.
|
virtual |
Get a CompositeValue from the CompositeValue.
n | the index number of the CompositeValue to get. |
Reimplemented from Dimension.
|
virtual |
Get a CompositeValue from the CompositeValue.
n | the index number of the CompositeValue to get. |
Reimplemented from Dimension.
AtomicValue * CompositeValue::getAtomicValue | ( | ) |
Get AtomicValue from the CompositeValue.
n | the index number of the AtomicValue to get is alway zero for AtomicValue. |
CompositeValue * CompositeValue::getCompositeValue | ( | unsigned int | n | ) |
Get a CompositeValue from the CompositeValue.
n | the index number of the CompositeValue to get. |
const string & CompositeValue::getDescription | ( | ) | const |
Returns the value of the "description" attribute of this CompositeValue.
|
virtual |
Returns the XML element name of this object, which for CompositeValue, is always "compositeValue"
.
"compositeValue"
. Reimplemented from Dimension.
const string & CompositeValue::getIndexValue | ( | ) | const |
Returns the value of the "indexValue" attribute of this CompositeValue.
|
virtual |
Returns the libNUML type code for the objects contained in this NUMLList (i.e., CompositeValue objects, if the list is non-empty).
NUML_UNKNOWN
(default).Reimplemented from Dimension.
Tuple * CompositeValue::getTuple | ( | ) |
|
inlinevirtual |
Returns the libNUML type code for this NUML object.
NUML_UNKNOWN
(default).Reimplemented from Dimension.
bool CompositeValue::isContentAtomicValue | ( | ) | const |
Predicate returning true
or false
depending on whether this CompositeValue object's content is AtomicValue object.
true
if the content of this CompositeValue object is AtomicValue object, false
otherwise.bool CompositeValue::isContentCompositeValue | ( | ) | const |
Predicate returning true
or false
depending on whether this CompositeValue object's content is another CompositeValue object.
true
if the content of this CompositeValue object is another CompositeValue object, false
otherwise.bool CompositeValue::isContentTuple | ( | ) | const |
Predicate returning true
or false
depending on whether this CompositeValue object's content is Tuple object.
true
if the content of this CompositeValue object is Tuple object, false
otherwise.
|
virtual |
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 CompositeValue 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 Dimension.
int CompositeValue::setDescription | ( | const std::string & | description | ) |
Sets the value of the "description" attribute of this NUML object.
The string in description
is copied.
description | the new description for the object |
int CompositeValue::setIndexValue | ( | const std::string & | indexValue | ) |
Sets the value of the "indexValue" attribute of this NUML object.
The string in indexValue
is copied.
indexValue | the new indexValue for the object |
|
virtual |
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.
Reimplemented from NUMLList.
|
protected |
|
protected |
|
protected |