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
ConnectionQtSqlSh.hpp
1 // Copyright © 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_PLUGIN_DATA_SHARED_CONNECTIONQTSQLSH_HPP_INCLUDED
5 #define FIRE_PLUGIN_DATA_SHARED_CONNECTIONQTSQLSH_HPP_INCLUDED
6 
7 #include <fire/gear/geom/shared/EnvelopeSh.hpp>
8 #include <fire/source/vector/ConnectionSpatialDb.hpp>
9 #include <fire/source/vector/shared/ConnectionSpatialDbSh.hpp>
10 
11 #include <string>
12 #include <exception>
13 
14 #include "fire/plugin-impl/connection/qt/ConnectionQtSql.hpp"
15 
16 namespace fire {
17 namespace connection {
18 namespace qt {
19 namespace shared {
20 
22  public:
23  explicit ConnectionQtSqlSh(ConnectionQtSql* ptr): ConnectionSpatialDbSh(ptr) {
24  }
25 
26  ConnectionQtSqlSh(ConnectionQtSqlSh const & c): ConnectionSpatialDbSh(c) {
27  }
28 
29  explicit ConnectionQtSqlSh(ConnectionSpatialDbSh const & c): ConnectionSpatialDbSh(c) {
30  }
31 
32  explicit ConnectionQtSqlSh(ConnectionVectorSh const & c): ConnectionSpatialDbSh(c) {
33  }
34 
35  explicit ConnectionQtSqlSh(ConnectionSh const & c): ConnectionSpatialDbSh(c) {
36  }
37 
38  inline int getSrid(const std::string & name, const std::string & schema, const std::string & geom) const {
39  return _getPtr()->getSrid(name, schema, geom);
40  }
41 
42  inline size_t getCount(const std::string & name, const std::string & schema) const {
43  return _getPtr()->getCount(name, schema);
44  }
45 
46  inline source::vector::Metadata::MetadataShp buildMetadata(const std::string & tblName, const std::string & schemaName) const {
47  return _getPtr()->buildMetadata(tblName, schemaName);
48  }
49 
50  inline source::vector::Metadata::MetadataShp buildMetadata(const std::string & sql, const source::vector::DataRow::MapSqlParam& params) const {
51  return _getPtr()->buildMetadata(sql, params);
52  }
53 
54  gear::geom::Envelope::EnvelopeShp getExtent(const std::string & tblName, const std::string & schemaName, const std::string & geomFld) const {
55  return _getPtr()->getExtent(tblName, schemaName, geomFld);
56  }
57 
58  inline ConnectionQtSqlSh & operator=(ConnectionQtSqlSh const & c) {
59  ConnectionSpatialDbSh::operator =(c);
60  return *this;
61  }
62 
63  inline ConnectionQtSqlSh & operator=(ConnectionSpatialDbSh const & c) {
64  ConnectionSpatialDbSh::operator =(c);
65  return *this;
66  }
67 
68  inline ConnectionQtSqlSh & operator=(ConnectionVectorSh const & c) {
69  ConnectionSpatialDbSh::operator =(c);
70  return *this;
71  }
72 
73  inline ConnectionQtSqlSh & operator=(ConnectionSh const & c) {
74  ConnectionSpatialDbSh::operator =(c);
75  return *this;
76  }
77 
78  inline gear::geom::Geometry *buff2Geom(QByteArray const& qba) const {
79  return _getPtr()->buff2Geom(qba);
80  }
81 
82  private:
83  inline ConnectionQtSql* _getPtr() {
84  ConnectionQtSql* ret = dynamic_cast< ConnectionQtSql* >(_ptr.get());
85  if (NULL == ret)
86  throw exception::Exception("Invalid ConnectionQtSqlSh pointer");
87 
88  return ret;
89  }
90 
91  inline const ConnectionQtSql* _getPtr() const {
92  const ConnectionQtSql* ret = dynamic_cast< const ConnectionQtSql* >(_ptr.get());
93  if (NULL == ret)
94  throw exception::Exception("Invalid ConnectionQtSql pointer");
95 
96  return ret;
97  }
98 };
99 
100 } // namespace shared
101 } // namespace qt
102 } // namespace connection
103 } // namespace fire
104 
105 #endif
Definition: EnvelopeSh.hpp:18
Definition: ConnectionQtSqlSh.hpp:21
Definition: ConnectionSpatialDbSh.hpp:20
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
Implementazione Connection per l'accesso a banche dati spaziali basato su QtSql.
Definition: ConnectionQtSql.hpp:35
Definition: MetadataSh.hpp:22
Definition: Geometry.hpp:69