Fire Core  8.0.0.alpha
GIS framework per tutti gli usi
 Tutto Classi Namespace Funzioni Variabili Ridefinizioni di tipo (typedef) Tipi enumerati (enum) Valori del tipo enumerato Friend
DataValue.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_PLUGIN_DATA_DATAVALUE_HPP_INCLUDED
5 #define FIRE_PLUGIN_DATA_DATAVALUE_HPP_INCLUDED
6 
7 #include <boost/thread/mutex.hpp>
8 #include <fire/gear/geom/Geometry.hpp>
9 
10 #include <string>
11 
12 #include "fire/gis/export.hpp"
13 #include "fire/source/vector/shared/FieldSh.hpp"
14 #include "fire/source/vector/shared/BufferSh.hpp"
15 #include "fire/source/vector/shared/DateTimeSh.hpp"
16 
17 namespace fire {
18 namespace source {
19 namespace vector {
20 
21 namespace shared {
22 class DataValueSh;
23 } // namespace shared
24 
28 class FIRE_GIS_DLL DataValue {
29  public:
31 
36  static const std::string NULL_TEXT();
37 
42  static DataValue* create(const Field::FieldShp &fld);
43 
48  explicit DataValue(Field::FieldShp const fld);
49 
54  DataValue(DataValue const & rhs);
55 
59  virtual ~DataValue();
60 
65  Field::FieldShp const getField() const;
66 
71  virtual bool isNull() const = 0;
72 
77  bool isChanged() const;
78 
82  void committed();
83 
88  virtual void set(const long long& val) = 0;
89 
94  virtual void set(const int& val) = 0;
95 
100  virtual void set(double const & val) = 0;
101 
106  virtual void set(std::string const & val) = 0;
107 
112  virtual void set(gear::geom::Geometry* val) = 0;
113 
118  virtual void set(gear::geom::Geometry const & val) = 0;
119 
124  virtual void set(const DateTime::DateTimeShp &val) = 0;
125 
130  virtual void set(Buffer::BufferShp val) = 0;
131 
136  virtual void set(bool const & val) = 0;
137 
142  virtual long long getInt() const = 0;
143 
148  virtual double getDouble() const = 0;
149 
154  virtual std::string getText() const = 0;
155 
160  virtual bool getBool() const = 0;
161 
166  virtual gear::geom::Geometry const & getGeometry() const = 0;
167  virtual gear::geom::Geometry & getGeometry() = 0;
168 
173  virtual DateTime::DateTimeShp const getDateTime() const = 0;
174  virtual DateTime::DateTimeShp getDateTime() = 0;
175 
180  virtual Buffer::BufferShp const getBlob() const = 0;
181  virtual Buffer::BufferShp getBlob() = 0;
182 
187  virtual DataValue::DataValueShp toInt() const;
188 
193  virtual DataValue::DataValueShp toDouble() const;
194 
199  virtual DataValue::DataValueShp toText() const;
200 
205  virtual DataValue::DataValueShp toDatetime() const;
206 
211  virtual DataValue::DataValueShp toBool() const;
212 
217  virtual DataValue::DataValueShp toGeometry() const;
218 
223  virtual DataValue::DataValueShp toBlob() const;
224 
225  protected:
226  DataValue& operator=(DataValue const & rhs);
227  void _invalidSet(std::string const & fromName, std::string const & typeName) const;
228  void _invalidConv(std::string const & fromName, std::string const & typeName) const;
229 
230  bool _changed;
231  Field::FieldShp _fld;
232  mutable boost::mutex _mtx;
233 };
234 
235 } // namespace vector
236 } // namespace source
237 } // namespace fire
238 
239 #endif
Definition: FieldSh.hpp:21
Valore della colonna di una DataRow identificata per nome o per indice.
Definition: DataValue.hpp:28
Definition: BufferSh.hpp:20
Definition: Geometry.hpp:69
Definition: DateTimeSh.hpp:21
Definition: DataValueSh.hpp:24