OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
FacResult.cpp
Go to the documentation of this file.
1// //////////////////////////////////////////////////////////////////////
2// Import section
3// //////////////////////////////////////////////////////////////////////
4// C
5#include <cassert>
6// OpenTrep
10
11namespace OPENTREP {
12
13 FacResult* FacResult::_instance = NULL;
14
15 // //////////////////////////////////////////////////////////////////////
16 FacResult::FacResult () {
17 }
18
19 // //////////////////////////////////////////////////////////////////////
20 FacResult::FacResult (const FacResult&) {
21 }
22
23 // //////////////////////////////////////////////////////////////////////
25 _instance = NULL;
26 }
27
28 // //////////////////////////////////////////////////////////////////////
29 FacResult& FacResult::instance () {
30
31 if (_instance == NULL) {
32 _instance = new FacResult();
33 assert (_instance != NULL);
34
36 }
37 return *_instance;
38 }
39
40 // //////////////////////////////////////////////////////////////////////
41 Result& FacResult::create (const TravelQuery_T& iQueryString,
42 const Xapian::Database& iXapianDatabase) {
43 Result* oResult_ptr = NULL;
44
45 oResult_ptr = new Result (iQueryString, iXapianDatabase);
46 assert (oResult_ptr != NULL);
47
48 // The new object is added to the Bom pool
49 _pool.push_back (oResult_ptr);
50
51 return *oResult_ptr;
52 }
53
54}
Result & create(const TravelQuery_T &, const Xapian::Database &)
Definition FacResult.cpp:41
static FacResult & instance()
Definition FacResult.cpp:29
static FacSupervisor & instance()
void registerBomFactory(FacBomAbstract *)
Class wrapping a set of Xapian documents having matched a given query string.
Definition Result.hpp:48
std::string TravelQuery_T