OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OPENTREP_Service.hpp
Go to the documentation of this file.
1 #ifndef __OPENTREP_SVC_OPENTREP_SERVICE_HPP
2 #define __OPENTREP_SVC_OPENTREP_SERVICE_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <iosfwd>
9 #include <string>
10 // OpenTREP
14 
15 namespace OPENTREP {
16 
17  // Forward declaration
18  class OPENTREP_ServiceContext;
19 
20 
25  public:
26  // /////////// Business Methods /////////////
33 
45 
53 
62 
74  NbOfMatches_T interpretTravelRequest (const std::string& iTravelQuery,
76 
77 
89  typedef std::pair<const TravelDBFilePath_T,
91  typedef std::pair<const PORFilePath_T, const DBFilePathPair_T> FilePathSet_T;
93 
94 
95  public:
96  // ////////// Constructors and destructors //////////
104  OPENTREP_Service (std::ostream& ioLogStream, const TravelDBFilePath_T&,
105  const SQLiteDBFilePath_T&);
106 
116  OPENTREP_Service (std::ostream& ioLogStream, const PORFilePath_T&,
117  const TravelDBFilePath_T&, const SQLiteDBFilePath_T&);
118 
123 
124 
125  private:
126  // /////// Construction and Destruction helper methods ///////
135 
143  void init (std::ostream& ioLogStream, const TravelDBFilePath_T&,
144  const SQLiteDBFilePath_T&);
145 
155  void init (std::ostream& ioLogStream, const PORFilePath_T&,
156  const TravelDBFilePath_T&, const SQLiteDBFilePath_T&);
157 
161  void finalise();
162 
163 
164  private:
165  // ///////// Service Context /////////
169  OPENTREP_ServiceContext* _opentrepServiceContext;
170  };
171 }
172 #endif // __OPENTREP_SVC_OPENTREP_SERVICE_HPP
std::pair< const TravelDBFilePath_T, const SQLiteDBFilePath_T > DBFilePathPair_T
unsigned short NbOfMatches_T
Class holding the context of the OpenTrep services.
unsigned int NbOfDBEntries_T
Interface for the OPENTREP Services.
std::list< Word_T > WordList_T
NbOfMatches_T drawRandomLocations(const NbOfMatches_T &iNbOfDraws, LocationList_T &)
std::list< Location > LocationList_T
NbOfDBEntries_T buildSearchIndex()
NbOfMatches_T interpretTravelRequest(const std::string &iTravelQuery, LocationList_T &, WordList_T &)
std::pair< const PORFilePath_T, const DBFilePathPair_T > FilePathSet_T
FilePathSet_T getFilePaths() const