libNuML 1.1.1
Library for reading / writing NuML documents
CompositeValue.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 COMPOSITEVALUES_H_
25#define COMPOSITEVALUES_H_
26
27#include <numl/common/extern.h>
28#include <numl/common/numlfwd.h>
29
30//#include <numl/Tuple.h>
31//#include <numl/AtomicValue.h>
32
33
34
35#include <numl/NMBase.h>
36#include <numl/NUMLList.h>
37#include <numl/Dimension.h>
38
39#ifdef __cplusplus
40LIBNUML_CPP_NAMESPACE_BEGIN
41
42//class CompositeValue;
43class NUMLDocument;
44class Tuple;
45class AtomicValue;
46/*
47 *
48 */
50{
51public:
52
72 CompositeValue (unsigned int level, unsigned int version);
73
96
102 virtual CompositeValue* clone () const;
103
111 virtual bool accept (NUMLVisitor& v) const;
112
132 virtual NUMLTypeCode_t getTypeCode () const { return NUML_COMPOSITEVALUE; };
133
134
140 const std::string& getIndexValue () const;
141
147 const std::string& getDescription () const;
148
163 int setIndexValue (const std::string& indexValue);
164
179 int setDescription (const std::string& description);
180
181
188 virtual const std::string& getElementName () const;
189
211 virtual NUMLTypeCode_t getItemTypeCode () const;
212
222 bool isContentCompositeValue () const;
223
233 bool isContentTuple () const;
234
244 bool isContentAtomicValue () const;
245
256 CompositeValue * getCompositeValue(unsigned int n);
257
268 Tuple * getTuple();
269
280 AtomicValue * getAtomicValue();
281
291 virtual const CompositeValue * get(unsigned int n) const;
292
302 virtual CompositeValue * get(unsigned int n);
303
314 virtual CompositeValue* remove(unsigned int n);
315
321 virtual void readAttributes (const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLAttributes& attributes);
322
323
329 virtual void writeAttributes (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& stream) const;
330
360 int addCompositeValue(const CompositeValue* compValue);
361
370
379
388
389// void setAtomicValue(AtomicValue* atomicValue) ;
390
391// void setTuple(Tuple* tuple) ;
392
398// virtual void writeElements(XMLOutputStream& stream) const;
399
400
401protected:
402
407 virtual NMBase* createObject (LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream& stream);
408 std::string mIndexValue;
409 std::string mDescription;
411
412};
413
414
415LIBNUML_CPP_NAMESPACE_END
416
417#endif /* __cplusplus */
418
419#ifndef SWIG
420
421LIBNUML_CPP_NAMESPACE_BEGIN
423
424//TODO
425
427LIBNUML_CPP_NAMESPACE_END
428
429#endif /* !SWIG */
430
431#endif /* COMPOSITEVALUES_H_ */
NUMLTypeCode_t
An enumeration of NUML types to help identify NUML objects at runtime.
Definition: NUMLTypeCodes.h:34
@ NUML_COMPOSITEVALUE
Definition: NUMLTypeCodes.h:43
This class stores the atomic values.
Definition: AtomicValue.h:40
This class stores the composite values.
Definition: CompositeValue.h:50
virtual NUMLTypeCode_t getTypeCode() const
Returns the libNUML type code for this NUML object.
Definition: CompositeValue.h:132
std::string mDescription
Definition: CompositeValue.h:409
NUMLTypeCode_t mContentType
Definition: CompositeValue.h:410
std::string mIndexValue
Definition: CompositeValue.h:408
this class stores the dimension information
Definition: Dimension.h:54
Tuple * createTuple()
creates a new tuple and adds it to the dimension
Definition: Dimension.cpp:120
virtual bool accept(NUMLVisitor &v) const
Accepts the given NUMLVisitor for this instance of Dimension.
Definition: Dimension.cpp:67
CompositeValue * createCompositeValue()
Creates a new CompositeValue and add it to Dimension's list inside this ResultComponent and return it...
Definition: Dimension.cpp:92
virtual NMBase * createObject(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLInputStream &stream)
Definition: Dimension.cpp:294
virtual Dimension * remove(unsigned int n)
Removes the nth item from this Dimension items and returns a pointer to it.
Definition: Dimension.cpp:254
virtual Dimension * clone() const
Creates and returns a deep copy of this Dimension instance.
Definition: Dimension.cpp:78
virtual Dimension * get(unsigned int n)
Get a CompositeValue from the Dimension.
Definition: Dimension.cpp:206
virtual NUMLTypeCode_t getItemTypeCode() const
Returns the libNUML type code for the objects contained in this NUMLList (i.e., CompositeValue object...
Definition: Dimension.cpp:180
virtual const std::string & getElementName() const
Returns the XML element name of this object.
Definition: Dimension.cpp:198
AtomicValue * createAtomicValue()
creates a new atomic value and adds it to the dimension
Definition: Dimension.cpp:148
This is the base class for all numl objects.
Definition: NMBase.h:71
This represents the numl document that contains all information.
Definition: NUMLDocument.h:107
virtual void writeAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream &stream) const
Subclasses should override this method to write their XML attributes to the XMLOutputStream.
Definition: NUMLList.cpp:441
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 spe...
Definition: NUMLList.cpp:410
namespace class
Definition: NUMLNamespaces.h:47
Implementation of the Visitor design pattern, for operations on NUML objects.
Definition: NUMLVisitor.h:73
stores tuple information
Definition: Tuple.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