libNuML  1.1.1
Library for reading / writing NuML documents
AtomicValue.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 ATOMICVALUE_H_
25 #define ATOMICVALUE_H_
26 
27 #include <numl/common/extern.h>
28 #include <numl/common/numlfwd.h>
29 
30 
31 #include <numl/Dimension.h>
32 #include <numl/NUMLList.h>
33 #include <numl/NUMLTypes.h>
34 #include <string>
35 #include <sstream>
36 
37 #ifdef __cplusplus
38 LIBNUML_CPP_NAMESPACE_BEGIN
39 
41 
42 public:
43 
61  AtomicValue (unsigned int level, unsigned int version);
62 
63 
92  AtomicValue (NUMLNamespaces* numlns);
93 
101  virtual bool accept (NUMLVisitor& v) const;
102 
103 
123  virtual NUMLTypeCode_t getTypeCode () const;
124 
131  virtual const std::string& getElementName () const;
132 
138  virtual const std::string& getValue () const;
139 
145  virtual double getDoubleValue ();
146 
147 
158  int setValue (const std::string& value);
159 
169  void writeChars(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& stream) const;
170 
177  //virtual void write(XMLOutputStream& stream) const;
178 
179 // virtual void write(XMLOutputStream& stream) const;
180 
181  virtual AtomicValue* clone () const;
182  AtomicValue();
183  virtual ~AtomicValue();
184 
185 protected:
186 
187  /* this is a constructor that takes no arguments and
188  * only exists because the validator code needs it
189  */
190  // AtomicValue ();
191 
200  //virtual NMBase* createObject (XMLInputStream& stream);
201  virtual void readAttributes(const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLAttributes & attributes);
202  virtual void writeAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream & stream) const;
203 
204 
205  std::string mValue;
206  //double mDoubleValue;
207 };
208 
209 LIBNUML_CPP_NAMESPACE_END
210 
211 #endif /* __cplusplus */
212 #endif /* ATOMICVALUE_H_ */
virtual bool accept(NUMLVisitor &v) const
Accepts the given NUMLVisitor for this instance of Dimension.
Definition: Dimension.cpp:67
virtual Dimension * clone() const
Creates and returns a deep copy of this Dimension instance.
Definition: Dimension.cpp:78
std::string mValue
Definition: AtomicValue.h:205
This class stores the atomic values.
Definition: AtomicValue.h:40
virtual const std::string & getElementName() const
Returns the XML element name of this object.
Definition: Dimension.cpp:198
NUMLTypeCode_t
An enumeration of NUML types to help identify NUML objects at runtime.
Definition: NUMLTypeCodes.h:33
#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 dimension information
Definition: Dimension.h:53
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
virtual NUMLTypeCode_t getTypeCode() const
Returns the libNUML type code for this NUML object.
Definition: Dimension.cpp:172