OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
FacResultHolder.cpp
Go to the documentation of this file.
1// //////////////////////////////////////////////////////////////////////
2// Import section
3// //////////////////////////////////////////////////////////////////////
4// C
5#include <cassert>
6// OPENTREP
12
13namespace OPENTREP {
14
15 FacResultHolder* FacResultHolder::_instance = NULL;
16
17 // //////////////////////////////////////////////////////////////////////
18 FacResultHolder::FacResultHolder () {
19 }
20
21 // //////////////////////////////////////////////////////////////////////
22 FacResultHolder::FacResultHolder (const FacResultHolder&) {
23 }
24
25 // //////////////////////////////////////////////////////////////////////
27 _instance = NULL;
28 }
29
30 // //////////////////////////////////////////////////////////////////////
31 FacResultHolder& FacResultHolder::instance () {
32
33 if (_instance == NULL) {
34 _instance = new FacResultHolder();
35 assert (_instance != NULL);
36
38 }
39 return *_instance;
40 }
41
42 // //////////////////////////////////////////////////////////////////////
44 const Xapian::Database& iDatabase) {
45 ResultHolder* oResultHolder_ptr = NULL;
46
47 oResultHolder_ptr = new ResultHolder (iQueryString, iDatabase);
48 assert (oResultHolder_ptr != NULL);
49
50 // The new object is added to the Bom pool
51 _pool.push_back (oResultHolder_ptr);
52
53 return *oResultHolder_ptr;
54 }
55
56 // //////////////////////////////////////////////////////////////////////
58 Result& ioResult) {
59 // Link the ResultHolder to the Result, and vice versa
60 ioResult._resultHolder = &ioResultHolder;
61
62 // Add the Result to the ResultHolder internal list (of Result objects)
63 ioResultHolder._resultList.push_back (&ioResult);
64 }
65
66}
static void initLinkWithResult(ResultHolder &, Result &)
static FacResultHolder & instance()
ResultHolder & create(const TravelQuery_T &iQueryString, const Xapian::Database &iDatabase)
static FacSupervisor & instance()
void registerBomFactory(FacBomAbstract *)
Class wrapping functions on a list of Result objects.
Class wrapping a set of Xapian documents having matched a given query string.
Definition Result.hpp:48
std::string TravelQuery_T