0.08.01
C++ Open Travel Request Parsing Library
Toggle main menu visibility
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
7
#include <
opentrep/bom/ResultHolder.hpp
>
8
#include <
opentrep/bom/Result.hpp
>
9
#include <
opentrep/factory/FacSupervisor.hpp
>
10
#include <
opentrep/factory/FacResultHolder.hpp
>
11
#include <
opentrep/service/Logger.hpp
>
12
13
namespace
OPENTREP
{
14
15
FacResultHolder
* FacResultHolder::_instance = NULL;
16
17
// //////////////////////////////////////////////////////////////////////
18
FacResultHolder::FacResultHolder () {
19
}
20
21
// //////////////////////////////////////////////////////////////////////
22
FacResultHolder::FacResultHolder (
const
FacResultHolder
&) {
23
}
24
25
// //////////////////////////////////////////////////////////////////////
26
FacResultHolder::~FacResultHolder
() {
27
_instance = NULL;
28
}
29
30
// //////////////////////////////////////////////////////////////////////
31
FacResultHolder&
FacResultHolder::instance
() {
32
33
if
(_instance == NULL) {
34
_instance =
new
FacResultHolder();
35
assert (_instance != NULL);
36
37
FacSupervisor::instance
().
registerBomFactory
(_instance);
38
}
39
return
*_instance;
40
}
41
42
// //////////////////////////////////////////////////////////////////////
43
ResultHolder
&
FacResultHolder::create
(
const
TravelQuery_T
& iQueryString,
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
// //////////////////////////////////////////////////////////////////////
57
void
FacResultHolder::initLinkWithResult
(
ResultHolder
& ioResultHolder,
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
}
FacResultHolder.hpp
FacSupervisor.hpp
Logger.hpp
ResultHolder.hpp
Result.hpp
OPENTREP::FacBomAbstract::_pool
BomPool_T _pool
Definition
FacBomAbstract.hpp:53
OPENTREP::FacResultHolder
Definition
FacResultHolder.hpp:23
OPENTREP::FacResultHolder::initLinkWithResult
static void initLinkWithResult(ResultHolder &, Result &)
Definition
FacResultHolder.cpp:57
OPENTREP::FacResultHolder::~FacResultHolder
virtual ~FacResultHolder()
Definition
FacResultHolder.cpp:26
OPENTREP::FacResultHolder::instance
static FacResultHolder & instance()
Definition
FacResultHolder.cpp:31
OPENTREP::FacResultHolder::create
ResultHolder & create(const TravelQuery_T &iQueryString, const Xapian::Database &iDatabase)
Definition
FacResultHolder.cpp:43
OPENTREP::FacSupervisor::instance
static FacSupervisor & instance()
Definition
FacSupervisor.cpp:21
OPENTREP::FacSupervisor::registerBomFactory
void registerBomFactory(FacBomAbstract *)
Definition
FacSupervisor.cpp:31
OPENTREP::ResultHolder
Class wrapping functions on a list of Result objects.
Definition
ResultHolder.hpp:26
OPENTREP::Result
Class wrapping a set of Xapian documents having matched a given query string.
Definition
Result.hpp:48
OPENTREP
Definition
BasChronometer.cpp:10
OPENTREP::TravelQuery_T
std::string TravelQuery_T
Definition
OPENTREP_Types.hpp:660
Generated on
for OpenTREP by
1.17.0