0.08.01
C++ Open Travel Request Parsing Library
Toggle main menu visibility
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
7
#include <
opentrep/bom/Result.hpp
>
8
#include <
opentrep/factory/FacSupervisor.hpp
>
9
#include <
opentrep/factory/FacResult.hpp
>
10
11
namespace
OPENTREP
{
12
13
FacResult
* FacResult::_instance = NULL;
14
15
// //////////////////////////////////////////////////////////////////////
16
FacResult::FacResult () {
17
}
18
19
// //////////////////////////////////////////////////////////////////////
20
FacResult::FacResult (
const
FacResult
&) {
21
}
22
23
// //////////////////////////////////////////////////////////////////////
24
FacResult::~FacResult
() {
25
_instance = NULL;
26
}
27
28
// //////////////////////////////////////////////////////////////////////
29
FacResult&
FacResult::instance
() {
30
31
if
(_instance == NULL) {
32
_instance =
new
FacResult();
33
assert (_instance != NULL);
34
35
FacSupervisor::instance
().
registerBomFactory
(_instance);
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
}
FacResult.hpp
FacSupervisor.hpp
Result.hpp
OPENTREP::FacBomAbstract::_pool
BomPool_T _pool
Definition
FacBomAbstract.hpp:53
OPENTREP::FacResult
Definition
FacResult.hpp:18
OPENTREP::FacResult::create
Result & create(const TravelQuery_T &, const Xapian::Database &)
Definition
FacResult.cpp:41
OPENTREP::FacResult::instance
static FacResult & instance()
Definition
FacResult.cpp:29
OPENTREP::FacResult::~FacResult
virtual ~FacResult()
Definition
FacResult.cpp:24
OPENTREP::FacSupervisor::instance
static FacSupervisor & instance()
Definition
FacSupervisor.cpp:21
OPENTREP::FacSupervisor::registerBomFactory
void registerBomFactory(FacBomAbstract *)
Definition
FacSupervisor.cpp:31
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