libNuML 1.1.1
Library for reading / writing NuML documents
ResultComponent Class Reference

stores the result component More...

#include <ResultComponent.h>

Inheritance diagram for ResultComponent:
NMBase

Public Member Functions

 ResultComponent (unsigned int level, unsigned int version)
 Creates a new ResultComponent using the given NUML level and version values. More...
 
virtual bool accept (NUMLVisitor &v) const
 Accepts the given NUMLVisitor for this instance of NMBase. More...
 
virtual ResultComponentclone () const
 Creates and returns a deep copy of this NMBase object. More...
 
const std::string & getId () const
 Returns the value of the "id" attribute of this ResultComponent. More...
 
int setId (const std::string &sid)
 
virtual void setNUMLDocument (NUMLDocument *d)
 Returns a list of the XML Namespaces declared on this NUML document. More...
 
virtual void setParentNUMLObject (NMBase *sb)
 Sets the parent NUML object of this NUML object. More...
 
virtual NUMLTypeCode_t getTypeCode () const
 Returns the libNUML type code for this NUML object. More...
 
virtual const std::string & getElementName () const
 Returns the XML element name of this object, which for ResultComponent, is always "model". More...
 
 ResultComponent (NUMLNamespaces *numlns)
 Creates a new ResultComponent using the given NUMLNamespaces object numlns. More...
 
DimensionDescriptioncreateDimensionDescription ()
 Creates a new DimensionDescription inside this ResultComponent and returns it. More...
 
CompositeDescriptioncreateCompositeDescription ()
 Creates a new CompositeDescription and add it to DimensionDescription's list inside this ResultComponent and return it. More...
 
CompositeValuecreateCompositeValue ()
 Creates a new CompositeValue and add it to Dimension's list inside this ResultComponent and return it. More...
 
TupleDescriptioncreateTupleDescription ()
 creates a new tupledescription and adds it to the dimensiondescription More...
 
TuplecreateTuple ()
 creates a new tuple and adds it to the dimension More...
 
AtomicDescriptioncreateAtomicDescription ()
 creates a new atomic description and adds it to the dimensiondescription More...
 
AtomicValuecreateAtomicValue ()
 creates a new atomic value and adds it to the dimension More...
 
DimensionDescriptiongetDimensionDescription ()
 Get the DimensionDescription object in this ResultComponent. More...
 
DimensiongetDimension ()
 Get the Dimension object in this ResultComponent. More...
 
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 ~ResultComponent ()
 
virtual NMBasecreateObject (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream)
 
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...
 
- Public Member Functions inherited from NMBase
virtual ~NMBase ()
 Destroy this object. More...
 
NMBaseoperator= (const NMBase &orig)
 Assignment operator for NMBase. More...
 
virtual bool accept (NUMLVisitor &v) const =0
 Accepts the given NUMLVisitor for this instance of NMBase. More...
 
virtual NMBaseclone () const =0
 Creates and returns a deep copy of this NMBase object. 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 NUMLDocumentgetNUMLDocument () const
 Returns the parent NUMLDocument object. More...
 
NUMLDocumentgetNUMLDocument ()
 Returns the parent NUMLDocument object. More...
 
NMBasegetParentNUMLObject ()
 Returns the parent NUML object. More...
 
NMBasegetAncestorOfType (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)
 
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...
 
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...
 
virtual NUMLTypeCode_t getTypeCode () const
 Returns the libnuml type code for this object. 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...
 
virtual const std::string & getElementName () const =0
 Returns the XML element name of this object. 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 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 bool hasRequiredAttributes () const
 
virtual bool hasRequiredElements () const
 
void setNUMLNamespaces (NUMLNamespaces *numlns)
 
NUMLNamespacesgetNUMLNamespaces () 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 &notes, bool addXHTMLMarkup=false)
 
int appendNotes (const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode *notes)
 
int appendNotes (const std::string &notes)
 
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

 ResultComponent ()
 
- Protected Member Functions inherited from NMBase
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 NMBasecreateObject (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream)
 Subclasses should override this method to create, store, and then return an NUML object corresponding to the next XMLToken in the XMLInputStream. More...
 
virtual bool readOtherXML (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream)
 Subclasses should override this method to read (and store) XHTML, MathML, etc. More...
 
virtual int getElementPosition () const
 The NUML XML Schema is written such that the order of child elements is significant. More...
 
NUMLErrorLoggetErrorLog ()
 
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...
 
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...
 
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 mId
 
DimensionDescription mDimensionDescription
 
Dimension mDimension
 
- Protected Attributes inherited from NMBase
std::string mMetaId
 
std::string mId
 
std::string mName
 
NUMLDocumentmNUML
 
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * mNotes
 
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNode * mAnnotation
 
NUMLNamespacesmNUMLNamespaces
 
unsigned int mLine
 
unsigned int mColumn
 
int mDept
 
NMBasemParentNUMLObject
 
bool mHasBeenDeleted
 
std::string mEmptyString
 

Detailed Description

stores the result component

Constructor & Destructor Documentation

◆ ResultComponent() [1/3]

LIBNUML_CPP_NAMESPACE_BEGIN ResultComponent::ResultComponent ( unsigned int  level,
unsigned int  version 
)

Creates a new ResultComponent using the given NUML level and version values.

Parameters
levelan unsigned int, the NUML Level to assign to this ResultComponent
versionan unsigned int, the NUML Version to assign to this ResultComponent
Note
Once a ResultComponent has been added to an NUMLDocument, the level, version for the document override those used to create the ResultComponent. 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.

◆ ResultComponent() [2/3]

ResultComponent::ResultComponent ( NUMLNamespaces numlns)

Creates a new ResultComponent 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.

Parameters
numlnsan NUMLNamespaces object.
Note
Once a ResultComponent has been added to an NUMLDocument, the level, version and xmlns namespaces for the document override those used to create the ResultComponent. 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.

◆ ~ResultComponent()

ResultComponent::~ResultComponent ( )
virtual

◆ ResultComponent() [3/3]

ResultComponent::ResultComponent ( )
protected

Member Function Documentation

◆ accept()

bool ResultComponent::accept ( NUMLVisitor v) const
virtual

Accepts the given NUMLVisitor for this instance of NMBase.

Parameters
vthe NUMLVisitor instance to be used.
Returns
the result of calling v.visit().

Implements NMBase.

◆ clone()

ResultComponent * ResultComponent::clone ( ) const
virtual

Creates and returns a deep copy of this NMBase object.

Returns
a (deep) copy of this NMBase object

Implements NMBase.

◆ createAtomicDescription()

AtomicDescription * ResultComponent::createAtomicDescription ( )

creates a new atomic description and adds it to the dimensiondescription

Returns
the created atomic description

◆ createAtomicValue()

AtomicValue * ResultComponent::createAtomicValue ( )

creates a new atomic value and adds it to the dimension

Returns
the created atomic value

◆ createCompositeDescription()

CompositeDescription * ResultComponent::createCompositeDescription ( )

Creates a new CompositeDescription and add it to DimensionDescription's list inside this ResultComponent and return it.

Returns
the CompositeDescription object created
See also
addCompositeDescription(const CompositeDescription *compDesc)

◆ createCompositeValue()

CompositeValue * ResultComponent::createCompositeValue ( )

Creates a new CompositeValue and add it to Dimension's list inside this ResultComponent and return it.

Returns
the CompositeValue object created
See also
addCompositeValue(const CompositeValue *compValue)

◆ createDimensionDescription()

DimensionDescription * ResultComponent::createDimensionDescription ( )

Creates a new DimensionDescription inside this ResultComponent and returns it.

Returns
the DimensionDescription object created
See also
addDimensionDescription(const DimensionDescription *r)

◆ createObject()

NMBase * ResultComponent::createObject ( LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &  stream)
virtual
Returns
the NUML object corresponding to next XMLToken in the XMLInputStream or NULL if the token was not recognized.

Reimplemented from NMBase.

◆ createTuple()

Tuple * ResultComponent::createTuple ( )

creates a new tuple and adds it to the dimension

Returns
the created tuple

◆ createTupleDescription()

TupleDescription * ResultComponent::createTupleDescription ( )

creates a new tupledescription and adds it to the dimensiondescription

Returns
the created tuple description

◆ getDimension()

Dimension * ResultComponent::getDimension ( )

Get the Dimension object in this ResultComponent.

Returns
the Dimension of this ResultComponent.

◆ getDimensionDescription()

DimensionDescription * ResultComponent::getDimensionDescription ( )

Get the DimensionDescription object in this ResultComponent.

Returns
the DimensionDescription of this ResultComponent.

◆ getElementName()

const string & ResultComponent::getElementName ( ) const
virtual

Returns the XML element name of this object, which for ResultComponent, is always "model".

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

Implements NMBase.

◆ getId()

const string & ResultComponent::getId ( ) const
virtual

Returns the value of the "id" attribute of this ResultComponent.

Returns
the id of this ResultComponent.

Reimplemented from NMBase.

◆ getTypeCode()

NUMLTypeCode_t ResultComponent::getTypeCode ( ) const
virtual

Returns the libNUML type code for this NUML object.

Returns
the NUML type code for this object, or NUML_UNKNOWN (default).
See also
getElementName()

Reimplemented from NMBase.

◆ readAttributes()

void ResultComponent::readAttributes ( const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLAttributes &  attributes)
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 NMBase.

◆ setId()

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

Reimplemented from NMBase.

◆ setNUMLDocument()

void ResultComponent::setNUMLDocument ( NUMLDocument d)
virtual

Returns a list of the XML Namespaces declared on this NUML document.

Sets the parent NUMLDocument of this NUML object.

Returns
the XML Namespaces associated with this NUML object Sets the parent NUMLDocument of this NUML object.
Parameters
dthe NUMLDocument object to use
dthe NUMLDocument object to use

Reimplemented from NMBase.

◆ setParentNUMLObject()

void ResultComponent::setParentNUMLObject ( NMBase sb)
virtual

Sets the parent NUML object of this NUML object.

Parameters
sbthe NUML object to use

Reimplemented from NMBase.

◆ writeAttributes()

void ResultComponent::writeAttributes ( LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream &  stream) const
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 NMBase.

◆ writeElements()

void ResultComponent::writeElements ( LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream &  stream) const
virtual

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 NMBase.

Member Data Documentation

◆ mDimension

Dimension ResultComponent::mDimension
protected

◆ mDimensionDescription

DimensionDescription ResultComponent::mDimensionDescription
protected

◆ mId

std::string ResultComponent::mId
protected

The documentation for this class was generated from the following files: