OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
OPENTREP::FacXapianDB Class Reference

Factory for a Xapian WritableDatabase object. More...

#include <opentrep/factory/FacXapianDB.hpp>

Public Types

typedef std::vector< Xapian::WritableDatabase * > XapianDBPool_T
 

Public Member Functions

void clean ()
 
 ~FacXapianDB ()
 
Xapian::WritableDatabase * create (const TravelDBFilePath_T &, const int &iXapianActionFlag)
 

Static Public Member Functions

static FacXapianDBinstance ()
 

Detailed Description

Factory for a Xapian WritableDatabase object.

Definition at line 22 of file FacXapianDB.hpp.

Member Typedef Documentation

◆ XapianDBPool_T

typedef std::vector<Xapian::WritableDatabase*> OPENTREP::FacXapianDB::XapianDBPool_T

Define the list (pool) of Xapian DB objects.

Definition at line 28 of file FacXapianDB.hpp.

Constructor & Destructor Documentation

◆ ~FacXapianDB()

OPENTREP::FacXapianDB::~FacXapianDB ( )

Destructor.

The Destruction put the _instance to NULL in order to be clean for the next FacXapianDB::instance()

Definition at line 19 of file FacXapianDB.cpp.

References clean().

Member Function Documentation

◆ instance()

FacXapianDB & OPENTREP::FacXapianDB::instance ( )
static

Provide the unique instance.

The singleton is instantiated when first used

Returns
FacXapianDB&

Definition at line 39 of file FacXapianDB.cpp.

References OPENTREP::FacSupervisor::instance(), and OPENTREP::FacSupervisor::registerXapianDBFactory().

◆ clean()

void OPENTREP::FacXapianDB::clean ( )

Destroy all the object instantiated by this factory.

Definition at line 25 of file FacXapianDB.cpp.

Referenced by ~FacXapianDB().

◆ create()

Xapian::WritableDatabase * OPENTREP::FacXapianDB::create ( const TravelDBFilePath_T & iTravelIndexFilePath,
const int & iXapianActionFlag )

Create a new Xapian WritableDatabase object.

This new object is added to the list of instantiated objects.

Parameters
constTravelDBFilePath_T& File-path of the Xapian database/index.
constint& Xapian action flag (usually Xapian::DB_CREATE)
Returns
Xapian::WritableDatabase& The newly created object.

Definition at line 49 of file FacXapianDB.cpp.

References OPENTREP_LOG_ERROR.


The documentation for this class was generated from the following files: