libNuML  1.1.1
Library for reading / writing NuML documents
Dimension.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 DIMENSION_H_
25 #define DIMENSION_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 #include <numl/NUMLList.h>
36 #include <numl/NUMLVisitor.h>
37 #include <numl/NUMLError.h>
38 #include <numl/NMBase.h>
39 
40 
41 #include <string>
42 
43 #ifdef __cplusplus
44 
46 
47 class CompositeValue;
48 class Tuple;
49 class AtomicValue;
50 
51 class NUMLDocument;
52 
54 {
55 public:
56 
57  Dimension();
58 
76  Dimension (unsigned int level, unsigned int version);
77 
106  Dimension (NUMLNamespaces* numlns);
114  virtual bool accept (NUMLVisitor& v) const;
115 
121  virtual Dimension* clone () const;
122 
130  CompositeValue* createCompositeValue ();
131 
136  Tuple* createTuple();
137 
142  AtomicValue* createAtomicValue();
143 
163  virtual NUMLTypeCode_t getTypeCode () const;
164 
165 
187  virtual NUMLTypeCode_t getItemTypeCode () const;
188 
196  virtual const std::string& getElementName () const;
197 
198 
208  virtual Dimension * get(unsigned int n);
209 
210 
220  virtual const Dimension * get(unsigned int n) const;
221 
222 
237  virtual CompositeValue* get (const std::string& sid);
238 
239 
254  virtual const CompositeValue* get (const std::string& sid) const;
255 
256 
267  virtual Dimension* remove (unsigned int n);
268 
269 
282  virtual Dimension* remove (const std::string& sid);
283 
284 
298  virtual int getElementPosition () const;
299 
305  //virtual void writeElements(XMLOutputStream& stream) const;
306 
307  virtual ~Dimension();
308 
309 protected:
310 
315  virtual NMBase* createObject (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream& stream);
316 
317  enum DimensionType { Unknown, CompositeValueType, TupleType, AtomicValueType };
319 
323  void setType (DimensionType type);
324 
325 };
326 
328 
329 #endif /* __cplusplus */
330 
331 
332 
333 #ifndef SWIG
334 
337 
338 //TODO
339 
342 
343 #endif /* !SWIG */
344 #endif /* DIMENSION_H_ */
This is the base class for all numl objects.
Definition: NMBase.h:70
#define BEGIN_C_DECLS
Definition: extern.h:112
virtual NUMLTypeCode_t getItemTypeCode() const
Get the type code of the objects contained in this NUMLList.
Definition: NUMLList.cpp:361
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 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:1714
virtual const std::string & getElementName() const
Returns the XML element name of this object, which for NUMLList, is always "listOf".
Definition: NUMLList.cpp:372
stores tuple information
Definition: Tuple.h:44
virtual const NMBase * get(unsigned int n) const
Get an item from the list.
Definition: NUMLList.cpp:156
virtual bool accept(NUMLVisitor &v) const
Accepts the given NUMLVisitor.
Definition: NUMLList.cpp:108
#define LIBNUML_CPP_NAMESPACE_BEGIN
Definition: libnuml-namespace.h:71
Definition: Dimension.h:317
This class stores the atomic values.
Definition: AtomicValue.h:40
Parent class for the various NUML list classes e.g.
Definition: NUMLList.h:45
DimensionType
Definition: Dimension.h:317
DimensionType mType
Definition: Dimension.h:318
virtual NMBase * clone() const
Creates and returns a deep copy of this NUMLList.
Definition: NUMLList.cpp:122
NUMLTypeCode_t
An enumeration of NUML types to help identify NUML objects at runtime.
Definition: NUMLTypeCodes.h:33
This represents the numl document that contains all information.
Definition: NUMLDocument.h:106
#define LIBNUML_EXTERN
Begin svn Header.
Definition: extern.h:104
Implementation of the Visitor design pattern, for operations on NUML objects.
Definition: NUMLVisitor.h:72
namespace class
Definition: NUMLNamespaces.h:46
This class stores the composite values.
Definition: CompositeValue.h:49
#define END_C_DECLS
Definition: extern.h:113
this class stores the dimension information
Definition: Dimension.h:53
#define LIBNUML_CPP_NAMESPACE_END
Definition: libnuml-namespace.h:72
virtual NUMLTypeCode_t getTypeCode() const
Get the type code of the objects contained in this SedListOf.
Definition: NUMLList.cpp:350
virtual int getElementPosition() const
The NUML XML Schema is written such that the order of child elements is significant.
Definition: NMBase.cpp:2040