libNuML 1.1.1
Library for reading / writing NuML documents
NMBase.cpp File Reference
#include <sstream>
#include <sbml/xml/XMLError.h>
#include <sbml/xml/XMLErrorLog.h>
#include <sbml/xml/XMLOutputStream.h>
#include <sbml/xml/XMLInputStream.h>
#include <sbml/xml/XMLToken.h>
#include <sbml/xml/XMLNode.h>
#include <sbml/util/util.h>
#include <numl/NUMLError.h>
#include <numl/NUMLErrorLog.h>
#include <numl/NUMLDocument.h>
#include <numl/ResultComponent.h>
#include <numl/DimensionDescription.h>
#include <numl/NUMLList.h>
#include <numl/NMBase.h>
#include <numl/common/operationReturnValues.h>
#include <numl/AtomicValue.h>

Functions

LIBNUML_EXTERN const char * NMBase_getMetaId (NMBase_t *sb)
 Returns the value of the "metaid" attribute of the given NMBase_t structure. More...
 
LIBNUML_EXTERN const NUMLDocument_tNMBase_getNUMLDocument (NMBase_t *sb)
 ‍** More...
 
LIBNUML_EXTERN const NMBase_tNMBase_getParentNUMLObject (NMBase_t *sb)
 Returns the parent NMBase_t structure of the given NMBase_t structure. More...
 
LIBNUML_EXTERN unsigned int NMBase_getLevel (const NMBase_t *sb)
 Returns the NUML Level of the overall NUML document. More...
 
LIBNUML_EXTERN unsigned int NMBase_getVersion (const NMBase_t *sb)
 Returns the Version within the NUML Level of the overall NUML document. More...
 
LIBNUML_EXTERN int NMBase_isSetMetaId (const NMBase_t *sb)
 Predicate returning nonzero true or false depending on whether the given structure's "metaid" attribute has been set. More...
 
LIBNUML_EXTERN int NMBase_setMetaId (NMBase_t *sb, const char *metaid)
 Sets the value of the "metaid" attribute of the given object. More...
 
LIBNUML_EXTERN int NMBase_setNamespaces (NMBase_t *sb, LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces_t *xmlns)
 Sets the namespaces relevant of this NUML object. More...
 
LIBNUML_EXTERN int NMBase_unsetMetaId (NMBase_t *sb)
 Unsets the "metaid" attribute of the given object. More...
 
LIBNUML_EXTERN NUMLTypeCode_t NMBase_getTypeCode (const NMBase_t *sb)
 Returns the libNUML type code for the given structure. More...
 
LIBNUML_EXTERN const char * NMBase_getElementName (const NMBase_t *sb)
 Returns the XML element name of the given structure. More...
 
LIBNUML_EXTERN unsigned int NMBase_getLine (const NMBase_t *sb)
 Returns the line number on which the given object first appears in the XML representation of the NUML document. More...
 
LIBNUML_EXTERN unsigned int NMBase_getColumn (const NMBase_t *sb)
 Returns the column number on which the given object first appears in the XML representation of the NUML document. More...
 
LIBNUML_EXTERN int NMBase_hasValidLevelVersionNamespaceCombination (NMBase_t *sb)
 Predicate returning nonzero true or false depending on whether the object's level/version and namespace values correspond to a valid NUML specification. More...
 

Function Documentation

◆ NMBase_getColumn()

LIBNUML_EXTERN unsigned int NMBase_getColumn ( const NMBase_t sb)

Returns the column number on which the given object first appears in the XML representation of the NUML document.

Parameters
sbthe NMBase_t structure
Returns
the column number of this NUML object.
See also
getLine().

◆ NMBase_getElementName()

LIBNUML_EXTERN const char * NMBase_getElementName ( const NMBase_t sb)

Returns the XML element name of the given structure.

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

Parameters
sbthe NMBase_t structure

◆ NMBase_getLevel()

LIBNUML_EXTERN unsigned int NMBase_getLevel ( const NMBase_t sb)

Returns the NUML Level of the overall NUML document.

Parameters
sbthe NMBase_t structure to query
Returns
the NUML level of the given object.
See also
getVersion()

◆ NMBase_getLine()

LIBNUML_EXTERN unsigned int NMBase_getLine ( const NMBase_t sb)

Returns the line number on which the given object first appears in the XML representation of the NUML document.

Parameters
sbthe NMBase_t structure
Returns
the line number of the given structure
See also
getColumn().

◆ NMBase_getMetaId()

LIBNUML_EXTERN const char * NMBase_getMetaId ( NMBase_t sb)

Returns the value of the "metaid" attribute of the given NMBase_t structure.

Parameters
sbthe NMBase_t structure
Returns
the value of the "metaid" attribute of sb

◆ NMBase_getNUMLDocument()

LIBNUML_EXTERN const NUMLDocument_t * NMBase_getNUMLDocument ( NMBase_t sb)

‍**

‍** Returns the parent NUMLDocument_t structure of the given NMBase_t structure.

Parameters
sbthe NMBase_t structure
Returns
the parent NUMLDocument of this NUML object.

◆ NMBase_getParentNUMLObject()

LIBNUML_EXTERN const NMBase_t * NMBase_getParentNUMLObject ( NMBase_t sb)

Returns the parent NMBase_t structure of the given NMBase_t structure.

Parameters
sbthe NMBase_t structure
Returns
the parent NMBase of this NUML object.

◆ NMBase_getTypeCode()

LIBNUML_EXTERN NUMLTypeCode_t NMBase_getTypeCode ( const NMBase_t sb)

Returns the libNUML type code for the given structure.

This method MAY return the typecode of this NUML object or it MAY return NUML_UNKNOWN. That is, subclasses of NMBase are not required to implement this method to return a typecode. This method is meant primarily for the LibNUML C interface where class and subclass information is not readily available.

Parameters
sbthe NMBase_t structure
Returns
the NUMLTypeCode_t of this NUML object or NUML_UNKNOWN (default).
See also
getElementName()

◆ NMBase_getVersion()

LIBNUML_EXTERN unsigned int NMBase_getVersion ( const NMBase_t sb)

Returns the Version within the NUML Level of the overall NUML document.

Parameters
sbthe NMBase_t structure to query
Returns
the NUML version of the given object.
See also
getLevel()

◆ NMBase_hasValidLevelVersionNamespaceCombination()

LIBNUML_EXTERN int NMBase_hasValidLevelVersionNamespaceCombination ( NMBase_t sb)

Predicate returning nonzero true or false depending on whether the object's level/version and namespace values correspond to a valid NUML specification.

The valid combinations of NUML Level, Version and Namespace as of this release of libNUML are the following:

  • Level 1 Version 1 "http://www.numl.org/numl/level1/version1"
Parameters
sbthe NMBase_t structure
Returns
nonzero (true) if the level, version and namespace values of this NUML object correspond to a valid set of values, zero (false) otherwise.

◆ NMBase_isSetMetaId()

LIBNUML_EXTERN int NMBase_isSetMetaId ( const NMBase_t sb)

Predicate returning nonzero true or false depending on whether the given structure's "metaid" attribute has been set.

Parameters
sbthe NMBase_t structure to query
Returns
nonzero (for true) if the "metaid" attribute of this NUML object has been set, zero (for false) otherwise.

◆ NMBase_setMetaId()

LIBNUML_EXTERN int NMBase_setMetaId ( NMBase_t sb,
const char *  metaid 
)

Sets the value of the "metaid" attribute of the given object.

The string metaid is copied. The value of metaid must be an identifier conforming to the syntax defined by the XML 1.0 data type ID. Among other things, this type requires that a value is unique among all the values of type XML ID in an NUMLDocument. Although NUML only uses XML ID for the "metaid" attribute, callers should be careful if they use XML ID's in XML portions of a model that are not defined by NUML, such as in the application-specific content of the "annotation" subelement.

Parameters
sbthe NMBase_t structure
metaidthe identifier string to use as the value of the "metaid" attribute
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBNUML_OPERATION_SUCCESS
  • LIBNUML_INVALID_ATTRIBUTE_VALUE
  • LIBNUML_UNEXPECTED_ATTRIBUTE
Note
Using this function with the metaid set to NULL is equivalent to unsetting the "metaid" attribute.

◆ NMBase_setNamespaces()

LIBNUML_EXTERN int NMBase_setNamespaces ( NMBase_t sb,
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces_t xmlns 
)

Sets the namespaces relevant of this NUML object.

Parameters
sbthe NMBase_t structure
xmlnsthe namespaces to set
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBNUML_OPERATION_SUCCESS

◆ NMBase_unsetMetaId()

LIBNUML_EXTERN int NMBase_unsetMetaId ( NMBase_t sb)

Unsets the "metaid" attribute of the given object.

Parameters
sbthe NMBase_t structure
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBNUML_OPERATION_SUCCESS
  • LIBNUML_OPERATION_FAILED