OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DBManager.hpp
Go to the documentation of this file.
1 #ifndef __OPENTREP_CMD_DBMANAGER_HPP
2 #define __OPENTREP_CMD_DBMANAGER_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // OpenTrep
11 
12 // Forward declarations
13 namespace soci {
14  class session;
15  class statement;
16 }
17 
18 namespace OPENTREP {
19 
20  // Forward declarations
21  struct PlaceKey;
22 
23 
28  class DBManager {
29  public:
40  const SQLiteDBFilePath_T&);
41 
49  static void updatePlaceInDB (soci::session&, const Place&);
50 
62  static bool retrievePlace (soci::session&, const LocationKey&, Place&);
63 
77  static bool retrieveClosestPlaces (soci::session&, const double& iLatitude,
78  const double& iLongitude,
80 
81 
82  public:
91  static void prepareSelectAllStatement (soci::session&, soci::statement&,
92  Place&);
101  static void prepareSelectFromCodeStatement (soci::session&,
102  soci::statement&, Place&);
103 
112  static void prepareSelectFromCoordStatement (soci::session&,
113  soci::statement&,
114  const double& iLatitude,
115  const double& iLongitude);
116 
126  static bool iterateOnStatement (soci::statement&, Place&);
127 
128 
129  private:
141  static void prepareSelectOnPlaceCodeStatement(soci::session&,
142  soci::statement&,
143  const std::string& iPlaceCode,
144  const std::string& iIcaoCode,
145  const GeonamesID_T&, Place&);
146 
156  static void prepareSelectOnDocIDStatement (soci::session&, soci::statement&,
157  const XapianDocID_T&, Place&);
158 
159 
160  private:
164  DBManager() {}
168  DBManager (const DBManager&) {}
172  ~DBManager() {}
173  };
174 
175 }
176 #endif // __OPENTREP_CMD_DBMANAGER_HPP
Class modelling the primary key of a location/POR (point of reference).
Definition: LocationKey.hpp:21
static void updatePlaceInDB(soci::session &, const Place &)
Definition: DBManager.cpp:410
static NbOfDBEntries_T buildSQLDB(const PORFilePath_T &, const SQLiteDBFilePath_T &)
Definition: DBManager.cpp:516
static void prepareSelectFromCodeStatement(soci::session &, soci::statement &, Place &)
Definition: DBManager.cpp:109
unsigned int NbOfDBEntries_T
static void prepareSelectFromCoordStatement(soci::session &, soci::statement &, const double &iLatitude, const double &iLongitude)
Definition: DBManager.cpp:172
Class modelling a place/POR (point of reference).
Definition: Place.hpp:28
static bool iterateOnStatement(soci::statement &, Place &)
Definition: DBManager.cpp:388
static void prepareSelectAllStatement(soci::session &, soci::statement &, Place &)
Definition: DBManager.cpp:22
static bool retrievePlace(soci::session &, const LocationKey &, Place &)
Definition: DBManager.cpp:449
std::list< Place * > PlaceOrderedList_T
Definition: PlaceList.hpp:21
static bool retrieveClosestPlaces(soci::session &, const double &iLatitude, const double &iLongitude, PlaceOrderedList_T &)
Definition: DBManager.cpp:494
Class building the Business Object Model (BOM) from data retrieved from the database.
Definition: DBManager.hpp:28