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
ConnectionVectorSh.hpp
1 // Copyright © 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_PLUGIN_DATA_SHARED_CONNECTIONVECTORSH_HPP_INCLUDED
5 #define FIRE_PLUGIN_DATA_SHARED_CONNECTIONVECTORSH_HPP_INCLUDED
6 
7 #include <string>
8 #include <exception>
9 
10 #include "fire/gis/export.hpp"
11 #include "fire/exception/Exception.hpp"
12 #include "fire/source/shared/ConnectionSh.hpp"
13 #include "fire/source/vector/ConnectionVector.hpp"
14 #include "fire/source/vector/shared/DataSetSh.hpp"
15 
16 namespace fire {
17 namespace source {
18 namespace vector {
19 namespace shared {
20 
21 class FIRE_GIS_DLL ConnectionVectorSh : public source::shared::ConnectionSh {
22  public:
24  }
25 
27  }
28 
29  inline ConnectionVectorSh & operator=(ConnectionVectorSh const & c) {
30  source::shared::ConnectionSh::operator =(c);
31  return *this;
32  }
33 
34  inline ConnectionVectorSh & operator=(source::shared::ConnectionSh const & c) {
35  source::shared::ConnectionSh::operator =(c);
36  return *this;
37  }
38 
39  inline virtual bool isEmpty() const {
40  return _getPtr() == NULL;
41  }
42 
43  inline virtual VectorLayerInfo::VectorLayerInfoShp getLayerInfo(std::string const & name) const {
44  return _getPtr()->getLayerInfo(name);
45  }
46 
47  inline virtual DataSet::DataSetShp const getData(const std::string &schema, std::string const & tbl) const {
48  return _getPtr()->getData(schema, tbl);
49  }
50 
51  inline VectorLayerInfo::VectorLayerInfoShp createTable(const Metadata::MetadataShp& mtd) {
52  return _getPtr()->createTable(mtd);
53  }
54 
55  inline VectorLayerInfo::VectorLayerInfoShp createTable(const Metadata::MetadataShp& mtd, const source::vector::VectorLayerInfo::VctEnvelope& extents) {
56  return _getPtr()->createTable(mtd, extents);
57  }
58 
59  inline virtual DataSet::DataSetShp getData(const std::string &schema, std::string const & tbl) {
60  return _getPtr()->getData(schema, tbl);
61  }
62 
63  inline virtual DataSet::DataSetShp const getData(const std::string &schema, std::string const & tbl, gear::geom::Envelope::EnvelopeShp const & rect) const {
64  return _getPtr()->getData(schema, tbl, rect);
65  }
66 
67  inline virtual DataSet::DataSetShp getData(const std::string &schema, std::string const & tbl, gear::geom::Envelope::EnvelopeShp const & rect) {
68  return _getPtr()->getData(schema, tbl, rect);
69  }
70 
71  inline virtual DataSet::DataSetShp const execQuery(std::string const & query, const DataRow::MapSqlParam& params = DataRow::MapSqlParam()) const {
72  return _getPtr()->execQuery(query, params);
73  }
74 
75  inline virtual DataSet::DataSetShp execQuery(std::string const & query, const DataRow::MapSqlParam& params = DataRow::MapSqlParam()) {
76  return _getPtr()->execQuery(query, params);
77  }
78 
79  inline virtual void eraseTable(const std::string& schema, const std::string& tbl, const VectorLayerType::VectorLayerType vlt) {
80  return _getPtr()->eraseTable(schema, tbl, vlt);
81  }
82 
83  inline virtual void execUpdate(std::string const & query, DataRow::MapSqlParam const & params) {
84  _getPtr()->execUpdate(query, params);
85  }
86 
87  inline virtual void execUpdate(std::string const & query) {
88  _getPtr()->execUpdate(query);
89  }
90 
91  inline virtual void saveOrUpdate(DataRow& row) {
92  _getPtr()->saveOrUpdate(row);
93  }
94 
95  inline virtual void insert(DataRow& row) {
96  _getPtr()->insert(row);
97  }
98 
99  inline virtual void update(DataRow& row) {
100  _getPtr()->update(row);
101  }
102 
103  inline virtual void erase(DataRow& row) {
104  _getPtr()->erase(row);
105  }
106 
107  private:
108  inline ConnectionVector* _getPtr() {
109  ConnectionVector* ret = dynamic_cast< ConnectionVector* >(_ptr.get());
110  if (NULL == ret)
111  throw fire::exception::Exception("Invalid ConnectionVector pointer");
112 
113  return ret;
114  }
115 
116  inline const ConnectionVector* _getPtr() const {
117  const ConnectionVector* ret = dynamic_cast< const ConnectionVector* >(_ptr.get());
118  if (NULL == ret)
119  throw fire::exception::Exception("Invalid ConnectionVector pointer");
120 
121  return ret;
122  }
123 };
124 } // namespace shared
125 } // namespace vector
126 } // namespace source
127 } // namespace fire
128 
129 #endif
Definition: DataSetSh.hpp:21
Definition: EnvelopeSh.hpp:18
Specializzazione di una connessione per sorgenti dati vettoriali.
Definition: ConnectionVector.hpp:30
std::map< std::string, DataValue::DataValueShp > MapSqlParam
Mappa di parametri usata per query SQL parametriche.
Definition: DataRow.hpp:47
Classe per la gestione di un'eccezione generica.
Definition: Exception.hpp:26
Definition: MetadataSh.hpp:22
Definition: ConnectionSh.hpp:21
Oggetto per l'accesso alle colonne di una riga di dati.
Definition: DataRow.hpp:32
Definition: VectorLayerInfoSh.hpp:23
Definition: ConnectionVectorSh.hpp:21