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 FacXapianDB & | instance () |
Factory for a Xapian WritableDatabase object.
Definition at line 22 of file FacXapianDB.hpp.
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.
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().
|
static |
Provide the unique instance.
The singleton is instantiated when first used
Definition at line 39 of file FacXapianDB.cpp.
References OPENTREP::FacSupervisor::instance(), and OPENTREP::FacSupervisor::registerXapianDBFactory().
void OPENTREP::FacXapianDB::clean | ( | ) |
Destroy all the object instantiated by this factory.
Definition at line 25 of file FacXapianDB.cpp.
Referenced by ~FacXapianDB().
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.
const | TravelDBFilePath_T& File-path of the Xapian database/index. |
const | int& Xapian action flag (usually Xapian::DB_CREATE) |
Definition at line 49 of file FacXapianDB.cpp.
References OPENTREP_LOG_ERROR.