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

namespace class More...

#include <NUMLNamespaces.h>

Public Member Functions

 NUMLNamespaces (unsigned int level=NUML_DEFAULT_LEVEL, unsigned int version=NUML_DEFAULT_VERSION)
 Creates a new NUMLNamespaces object corresponding to the given NUML level and version. More...
 
 ~NUMLNamespaces ()
 Destroys this NUMLNamespaces object. More...
 
 NUMLNamespaces (const NUMLNamespaces &orig)
 Copy constructor; creates a copy of a NUMLNamespaces. More...
 
NUMLNamespacesoperator= (const NUMLNamespaces &orig)
 Assignment operator for NUMLNamespaces. More...
 
NUMLNamespacesclone () const
 Creates and returns a deep copy of this NUMLNamespaces. More...
 
unsigned int getLevel ()
 Get the NUML Level of this NUMLNamespaces object. More...
 
unsigned int getVersion ()
 Get the NUML Version of this NUMLNamespaces object. More...
 
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * getNamespaces ()
 Get the XML namespaces list for this NUMLNamespaces object. More...
 
void addNamespaces (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces *xmlns)
 Add the XML namespaces list to the set of namespaces within this NUMLNamespaces object. More...
 
void setLevel (unsigned int level)
 
void setVersion (unsigned int version)
 
void setNamespaces (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces *xmlns)
 

Static Public Member Functions

static std::string getNUMLNamespaceURI (unsigned int level, unsigned int version)
 Returns a string representing the NUML XML namespace for the given level and version of NUML. More...
 

Protected Attributes

unsigned int mLevel
 
unsigned int mVersion
 
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * mNamespaces
 

Detailed Description

namespace class

Constructor & Destructor Documentation

◆ NUMLNamespaces() [1/2]

LIBNUML_CPP_NAMESPACE_BEGIN NUMLNamespaces::NUMLNamespaces ( unsigned int  level = NUML_DEFAULT_LEVEL,
unsigned int  version = NUML_DEFAULT_VERSION 
)

Creates a new NUMLNamespaces object corresponding to the given NUML level and version.

NUMLNamespaces objects are used in libNUML to communicate NUML Level and Version data between constructors and other methods. The NUMLNamespaces object class tracks 3-tuples (triples) consisting of NUML Level, Version, and the corresponding NUML XML namespace. Most constructors for NUML objects in libNUML take a NUMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given NUML Level and Version.

The plural name "NUMLNamespaces" is not a mistake, because in NUML Level 3, objects may have extensions added by Level 3 packages used by a given model; however, until the introduction of NUML Level 3, the NUMLNamespaces object only records one NUML Level/Version/namespace combination at a time.

Parameters
levelthe NUML level
versionthe NUML version

@docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libNUML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libNUML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

◆ ~NUMLNamespaces()

NUMLNamespaces::~NUMLNamespaces ( )

Destroys this NUMLNamespaces object.

◆ NUMLNamespaces() [2/2]

NUMLNamespaces::NUMLNamespaces ( const NUMLNamespaces orig)

Copy constructor; creates a copy of a NUMLNamespaces.

Parameters
origthe NUMLNamespaces instance to copy.

Member Function Documentation

◆ addNamespaces()

void NUMLNamespaces::addNamespaces ( LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces *  xmlns)

Add the XML namespaces list to the set of namespaces within this NUMLNamespaces object.

Parameters
xmlnsthe XML namespaces to be added.

◆ clone()

NUMLNamespaces * NUMLNamespaces::clone ( ) const

Creates and returns a deep copy of this NUMLNamespaces.

Returns
a (deep) copy of this NUMLNamespaces.

◆ getLevel()

unsigned int NUMLNamespaces::getLevel ( )

Get the NUML Level of this NUMLNamespaces object.

Returns
the NUML Level of this NUMLNamespaces object.

◆ getNamespaces()

LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * NUMLNamespaces::getNamespaces ( )

Get the XML namespaces list for this NUMLNamespaces object.

The plural is not a mistake, because in NUML Level 3, objects may have extensions added by Level 3 packages used by a given model, and therefore there may be multiple XML namespaces involved too. However, until the introduction of NUML Level 3, the NUMLNamespaces object only records one NUML Level/Version/namespace combination at a time, and so this method will also only return a list of one item.

Returns
the XML namespaces of this NUMLNamespaces object.

◆ getNUMLNamespaceURI()

std::string NUMLNamespaces::getNUMLNamespaceURI ( unsigned int  level,
unsigned int  version 
)
static

Returns a string representing the NUML XML namespace for the given level and version of NUML.

Parameters
levelthe NUML level
versionthe NUML version
Returns
a string representing the NUML namespace that reflects the NUML Level and Version specified.

◆ getVersion()

unsigned int NUMLNamespaces::getVersion ( )

Get the NUML Version of this NUMLNamespaces object.

Returns
the NUML Version of this NUMLNamespaces object.

◆ operator=()

NUMLNamespaces & NUMLNamespaces::operator= ( const NUMLNamespaces orig)

Assignment operator for NUMLNamespaces.

◆ setLevel()

void NUMLNamespaces::setLevel ( unsigned int  level)

◆ setNamespaces()

void NUMLNamespaces::setNamespaces ( LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces *  xmlns)

◆ setVersion()

void NUMLNamespaces::setVersion ( unsigned int  version)

Member Data Documentation

◆ mLevel

unsigned int NUMLNamespaces::mLevel
protected

◆ mNamespaces

LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces* NUMLNamespaces::mNamespaces
protected

◆ mVersion

unsigned int NUMLNamespaces::mVersion
protected

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