libNuML 1.1.1
Library for reading / writing NuML documents
DimensionDescription.h
Go to the documentation of this file.
1/*
2* ****************************************************************************
3* This file is part of libNUML. Please visit http://code.google.com/p/numl/for more
4* information about NUML, and the latest version of libNUML.
5* Copyright (c) 2013 The University of Manchester.
6*
7* This library is free software; you can redistribute it and/or modify it
8* under the terms of the GNU Lesser General Public License as published
9* by the Free Software Foundation. A copy of the license agreement is
10* provided in the file named "LICENSE.txt" included with this software
11* distribution and also available online as http://www.gnu.org/licenses/lgpl.html
12*
13* Contributors:
14* Joseph O. Dada, The University of Manchester - initial API and implementation
15* ****************************************************************************
16*/
17
24#ifndef DIMENSIONDESCRIPTION_H_
25#define DIMENSIONDESCRIPTION_H_
26
27#include <numl/common/extern.h>
28#include <numl/common/numlfwd.h>
29
30#include <sbml/xml/XMLNode.h>
31#include <sbml/xml/XMLAttributes.h>
32#include <sbml/xml/XMLInputStream.h>
33#include <sbml/xml/XMLOutputStream.h>
34
35
36//#include <numl/AtomicDescription.h>
37//#include <numl/CompositeDescription.h>
38//#include <numl/TupleDescription.h>
39
40#include <numl/NUMLVisitor.h>
41#include <numl/NUMLError.h>
42#include <numl/NMBase.h>
43#include <numl/NUMLList.h>
44
45#include <string>
46
47#ifdef __cplusplus
48
49LIBNUML_CPP_NAMESPACE_BEGIN
50
51class NUMLDocument;
55/*
56 *
57 */
59{
60public:
79 DimensionDescription (unsigned int level, unsigned int version);
80
103
104
112 virtual bool accept (NUMLVisitor& v) const;
113
114
120 virtual DimensionDescription* clone () const;
121
122
123 //TODO remove the following
124
130 // virtual XMLNamespaces* getNamespaces() const ;
131
137// virtual void setNUMLDocument (NUMLDocument* d);
138
139
140
146 // virtual void setParentNUMLObject (NMBase* sb);
147
155 CompositeDescription* createCompositeDescription();
156
161 TupleDescription* createTupleDescription();
162
167 AtomicDescription* createAtomicDescription();
168
169
176 virtual const std::string& getElementName () const;
177
178
199
200
222 virtual NUMLTypeCode_t getItemTypeCode () const;
223
231// virtual const std::string& getElementName () const;
232
233
243 virtual DimensionDescription * get(unsigned int n);
244
245
255 virtual const DimensionDescription * get(unsigned int n) const;
256
271 virtual DimensionDescription* get (const std::string& sid);
272
273
288 virtual const DimensionDescription* get (const std::string& sid) const;
289
290 virtual const std::string& getId() const;
291 virtual int setId(const std::string& id);
292
293 virtual const std::string& getName() const;
294 virtual int setName(const std::string& name);
295
306 virtual DimensionDescription* remove (unsigned int n);
307
308
321 virtual DimensionDescription* remove (const std::string& sid);
322
323
337 virtual int getElementPosition () const;
338
339
340 virtual ~DimensionDescription();
341
342
343protected:
344
349 virtual NMBase* createObject (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream& stream);
350
357 virtual void writeXMLNS(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& stream) const;
358
359 std::string mId;
360 std::string mName;
361
362};
363
364LIBNUML_CPP_NAMESPACE_END
365
366#endif /* __cplusplus */
367
368#ifndef SWIG
369
370LIBNUML_CPP_NAMESPACE_BEGIN
372
373//TODO
374
376LIBNUML_CPP_NAMESPACE_END
377
378#endif /* !SWIG */
379
380#endif /* DIMENSIONDESCRIPTION_H_ */
NUMLTypeCode_t
An enumeration of NUML types to help identify NUML objects at runtime.
Definition: NUMLTypeCodes.h:34
@ NUML_DIMENSIONDESCRIPTION
Definition: NUMLTypeCodes.h:42
This class stores the atomic description.
Definition: AtomicDescription.h:42
this class stores the component descriptions
Definition: CompositeDescription.h:58
This class stores the dimension description.
Definition: DimensionDescription.h:59
std::string mId
Definition: DimensionDescription.h:359
std::string mName
Definition: DimensionDescription.h:360
virtual NUMLTypeCode_t getTypeCode() const
Returns the libNUML type code for this NUML object.
Definition: DimensionDescription.h:198
This is the base class for all numl objects.
Definition: NMBase.h:71
virtual NMBase * createObject(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream)
Subclasses should override this method to create, store, and then return an NUML object corresponding...
Definition: NMBase.cpp:1715
virtual int setId(const std::string &sid)
Definition: NMBase.cpp:413
virtual const std::string & getName() const
Definition: NMBase.cpp:233
virtual int getElementPosition() const
The NUML XML Schema is written such that the order of child elements is significant.
Definition: NMBase.cpp:2041
virtual void writeXMLNS(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream &stream) const
Subclasses should override this method to write their xmlns attriubutes (if any) to the XMLOutputStre...
Definition: NMBase.cpp:1683
virtual const std::string & getId() const
Definition: NMBase.cpp:220
This represents the numl document that contains all information.
Definition: NUMLDocument.h:107
Parent class for the various NUML list classes e.g.
Definition: NUMLList.h:45
virtual const NMBase * get(unsigned int n) const
Get an item from the list.
Definition: NUMLList.cpp:156
virtual NUMLTypeCode_t getItemTypeCode() const
Get the type code of the objects contained in this NUMLList.
Definition: NUMLList.cpp:361
virtual NMBase * clone() const
Creates and returns a deep copy of this NUMLList.
Definition: NUMLList.cpp:122
virtual NMBase * remove(unsigned int n)
Removes the nth item from this NUMLList items and returns a pointer to it.
Definition: NUMLList.cpp:233
virtual bool accept(NUMLVisitor &v) const
Accepts the given NUMLVisitor.
Definition: NUMLList.cpp:108
virtual const std::string & getElementName() const
Returns the XML element name of this object, which for NUMLList, is always "listOf".
Definition: NUMLList.cpp:372
namespace class
Definition: NUMLNamespaces.h:47
Implementation of the Visitor design pattern, for operations on NUML objects.
Definition: NUMLVisitor.h:73
stores the tuple description
Definition: TupleDescription.h:45
#define BEGIN_C_DECLS
Definition: extern.h:112
#define LIBNUML_EXTERN
Begin svn Header.
Definition: extern.h:104
#define END_C_DECLS
Definition: extern.h:113