xapian-core  1.4.25
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
BackendManagerMulti Class Reference

BackendManager subclass for multi databases. More...

#include <backendmanager_multi.h>

+ Inheritance diagram for BackendManagerMulti:
+ Collaboration diagram for BackendManagerMulti:

Public Member Functions

 BackendManagerMulti (const std::string &datadir_, const std::vector< BackendManager *> &sub_manager_)
 
Xapian::Database get_remote_database (const std::vector< std::string > &files, unsigned int timeout)
 Get a remote database instance with the specified timeout. More...
 
Xapian::WritableDatabase get_writable_database (const std::string &name, const std::string &file)
 Create a Multi Xapian::WritableDatabase object indexing a single file. More...
 
std::string get_writable_database_path (const std::string &name)
 Get the path of Xapian::WritableDatabase instance. More...
 
std::string get_compaction_output_path (const std::string &name)
 Get a path to compact a database to. More...
 
std::string get_generated_database_path (const std::string &name)
 Get the path to use for generating a database, if supported. More...
 
Xapian::WritableDatabase get_writable_database_again ()
 Create a WritableDatabase object for the last opened WritableDatabase. More...
 
std::string get_writable_database_path_again ()
 Get the path of the last opened WritableDatabase. More...
 
- Public Member Functions inherited from BackendManager
 BackendManager (const std::string &datadir_, const std::string &dbtype_)
 Constructor. More...
 
virtual ~BackendManager ()
 We have virtual methods and want to be able to delete derived classes using a pointer to the base class, so we need a virtual destructor. More...
 
const std::string & get_dbtype () const
 Get the database type currently in use. More...
 
const std::string & get_datadir () const
 Get the directory to store data in. More...
 
Xapian::Database get_database (const std::vector< std::string > &files)
 Get a database instance of the current type. More...
 
Xapian::Database get_database (const std::string &file)
 Get a database instance of the current type, single file case. More...
 
Xapian::Database get_database (const std::string &dbname, void(*gen)(Xapian::WritableDatabase &, const std::string &), const std::string &arg)
 Get a database instance of the current type, generated case. More...
 
virtual Xapian::Database get_database_by_path (const std::string &path)
 Get a database instance by path. More...
 
std::string get_database_path (const std::vector< std::string > &files)
 Get the path of a database instance, if such a thing exists. More...
 
std::string get_database_path (const std::string &file)
 Get the path of a database instance, if such a thing exists (single file case). More...
 
std::string get_database_path (const std::string &dbname, void(*gen)(Xapian::WritableDatabase &, const std::string &), const std::string &arg)
 Get the path of a generated database instance. More...
 
virtual Xapian::WritableDatabase get_remote_writable_database (std::string args)
 Get a remote Xapian::WritableDatabase instance with specified args. More...
 
virtual Xapian::WritableDatabase get_generated_database (const std::string &name)
 Get a generated writable database instance. More...
 
virtual void finalise_generated_database (const std::string &name)
 Finalise the generated database. More...
 
virtual std::string get_writable_database_args (const std::string &path, unsigned int timeout)
 Get the args for opening a writable remote database with the specified timeout. More...
 
virtual Xapian::Database get_writable_database_as_database ()
 Create a Database object for the last opened WritableDatabase. More...
 
virtual void clean_up ()
 Called after each test, to perform any necessary cleanup. More...
 

Protected Member Functions

std::string do_get_database_path (const std::vector< std::string > &files)
 Get the path of the Xapian::Database instance. More...
 
- Protected Member Functions inherited from BackendManager
void index_files_to_database (Xapian::WritableDatabase &database, const std::vector< std::string > &files)
 Index data from zero or more text files into a database. More...
 
bool create_dir_if_needed (const std::string &dirname)
 Create the directory dirname if needed. More...
 
virtual Xapian::Database do_get_database (const std::vector< std::string > &files)
 Virtual method implementing get_database(). More...
 

Private Member Functions

void operator= (const BackendManagerMulti &)
 Don't allow assignment. More...
 
 BackendManagerMulti (const BackendManagerMulti &)
 Don't allow copying. More...
 
std::string createdb_multi (const std::string &name, const std::vector< std::string > &files)
 

Private Attributes

std::string last_wdb_path
 The path of the last writable database used. More...
 
std::vector< BackendManager * > sub_managers
 
std::string cachedir
 

Additional Inherited Members

- Static Public Member Functions inherited from BackendManager
static const char * get_xapian_progsrv_command ()
 Get the command line required to run xapian-progsrv. More...
 

Detailed Description

BackendManager subclass for multi databases.

Definition at line 33 of file backendmanager_multi.h.

Constructor & Destructor Documentation

◆ BackendManagerMulti() [1/2]

BackendManagerMulti::BackendManagerMulti ( const BackendManagerMulti )
private

Don't allow copying.

◆ BackendManagerMulti() [2/2]

BackendManagerMulti::BackendManagerMulti ( const std::string &  datadir_,
const std::vector< BackendManager *> &  sub_manager_ 
)

Member Function Documentation

◆ createdb_multi()

string BackendManagerMulti::createdb_multi ( const std::string &  name,
const std::vector< std::string > &  files 
)
private

◆ do_get_database_path()

string BackendManagerMulti::do_get_database_path ( const std::vector< std::string > &  files)
protectedvirtual

Get the path of the Xapian::Database instance.

Reimplemented from BackendManager.

Definition at line 218 of file backendmanager_multi.cc.

References createdb_multi().

◆ get_compaction_output_path()

string BackendManagerMulti::get_compaction_output_path ( const std::string &  name)
virtual

Get a path to compact a database to.

Reimplemented from BackendManager.

Definition at line 266 of file backendmanager_multi.cc.

References cachedir, and name.

◆ get_generated_database_path()

string BackendManagerMulti::get_generated_database_path ( const std::string &  name)
virtual

Get the path to use for generating a database, if supported.

Reimplemented from BackendManager.

Definition at line 272 of file backendmanager_multi.cc.

References get_writable_database_path().

◆ get_remote_database()

Xapian::Database BackendManagerMulti::get_remote_database ( const std::vector< std::string > &  files,
unsigned int  timeout 
)
virtual

Get a remote database instance with the specified timeout.

Reimplemented from BackendManager.

Definition at line 238 of file backendmanager_multi.cc.

References Xapian::Database::add_database(), and sub_managers.

◆ get_writable_database()

Xapian::WritableDatabase BackendManagerMulti::get_writable_database ( const std::string &  name,
const std::string &  file 
)
virtual

Create a Multi Xapian::WritableDatabase object indexing a single file.

Reimplemented from BackendManager.

Definition at line 224 of file backendmanager_multi.cc.

References createdb_multi().

◆ get_writable_database_again()

Xapian::WritableDatabase BackendManagerMulti::get_writable_database_again ( )
virtual

Create a WritableDatabase object for the last opened WritableDatabase.

Reimplemented from BackendManager.

Definition at line 278 of file backendmanager_multi.cc.

References last_wdb_path.

◆ get_writable_database_path()

string BackendManagerMulti::get_writable_database_path ( const std::string &  name)
virtual

Get the path of Xapian::WritableDatabase instance.

Reimplemented from BackendManager.

Definition at line 232 of file backendmanager_multi.cc.

References cachedir, and name.

Referenced by get_generated_database_path().

◆ get_writable_database_path_again()

string BackendManagerMulti::get_writable_database_path_again ( )
virtual

Get the path of the last opened WritableDatabase.

Reimplemented from BackendManager.

Definition at line 284 of file backendmanager_multi.cc.

References last_wdb_path.

◆ operator=()

void BackendManagerMulti::operator= ( const BackendManagerMulti )
private

Don't allow assignment.

Member Data Documentation

◆ cachedir

std::string BackendManagerMulti::cachedir
private

◆ last_wdb_path

std::string BackendManagerMulti::last_wdb_path
private

The path of the last writable database used.

Definition at line 41 of file backendmanager_multi.h.

Referenced by createdb_multi(), get_writable_database_again(), and get_writable_database_path_again().

◆ sub_managers

std::vector<BackendManager*> BackendManagerMulti::sub_managers
private

Definition at line 44 of file backendmanager_multi.h.

Referenced by BackendManagerMulti(), createdb_multi(), and get_remote_database().


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