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
ConnectionPool.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 #ifndef FIRE_GIS_DATA_CONNECTIONPOOL_HPP_INCLUDED
4 #define FIRE_GIS_DATA_CONNECTIONPOOL_HPP_INCLUDED
5 
6 #include <string>
7 #include <vector>
8 #include <exception>
9 
10 #include "fire/source/shared/ConnectionSh.hpp"
11 
12 namespace fire {
13 namespace gis {
14 namespace data {
19  public:
28  ConnectionPool(const std::string & cnnNmsp, const source::Connection::ConnectionParams& cnnPars, const int& num, const std::string &id = "");
29 
33  virtual ~ConnectionPool();
34 
40 
44  void close();
45 
50  size_t getCount() const;
51 
56  std::string getId() const;
57 
58  private:
59  typedef std::vector< source::Connection::ConnectionShp > VctConnectionShp;
60 
61  std::string _buildPoolId(const source::Connection::ConnectionParams& cnnPars) const;
62 
63  std::string _id;
64  unsigned int _idx;
65  VctConnectionShp _cnns;
66  mutable boost::mutex _mtx;
67  source::Connection::ConnectionParams _params;
68 };
69 } // namespace data
70 } // namespace gis
71 } // namespace fire
72 
73 #endif
Gestore di connessioni idempotenti verso una sorgente dati.
Definition: ConnectionPool.hpp:18
void close()
Chiude il ConnectionPool e tutte le connessioni.
virtual ~ConnectionPool()
Distruttore oggetto.
size_t getCount() const
Numero di connessioni totali presenti nel pool.
std::string getId() const
Chiave univoca a livello di sessione dell'istanza di ConnectionPool.
Definition: ConnectionSh.hpp:21
ConnectionPool(const std::string &cnnNmsp, const source::Connection::ConnectionParams &cnnPars, const int &num, const std::string &id="")
Costruttore oggetto.