BackendManager Class Reference

#include <backendmanager.h>

Inheritance diagram for BackendManager:

Inheritance graph
[legend]
Collaboration diagram for BackendManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Xapian::WritableDatabase getwritedb_flint (const std::string &name, const std::vector< std::string > &files)
 Get a writable flint database instance.
Xapian::WritableDatabase getwritedb_quartz (const std::string &name, const std::vector< std::string > &files)
 Get a writable quartz database instance.
 BackendManager ()
 Constructor - set up default state.
virtual ~BackendManager ()
 Virtual methods, so virtual destructor.
virtual const char * get_dbtype () const
 Get the database type currently in use.
void set_datadir (const std::string &datadir_)
 Set the directory to store data in.
const std::string & get_datadir () const
 Get the directory to store data in.
virtual Xapian::Database get_database (const std::vector< std::string > &dbnames)
 Get a database instance of the current type.
virtual Xapian::Database get_database (const std::string &dbname)
 Get a database instance of the current type, single file case.
virtual Xapian::WritableDatabase get_writable_database (const std::string &name, const std::string &file)
 Get a writable database instance.
virtual Xapian::Database get_remote_database (const std::vector< std::string > &files, unsigned int timeout)
 Get a remote database instance with the specified timeout.
virtual Xapian::Database get_writable_database_as_database ()
 Create a Database object for the last opened WritableDatabase.
virtual Xapian::WritableDatabase get_writable_database_again ()
 Create a WritableDatabase object for the last opened WritableDatabase.

Static Public Member Functions

static const char * get_xapian_progsrv_command ()
 Get the command line required to run xapian-progsrv.

Protected Member Functions

bool create_dir_if_needed (const std::string &dirname)
Xapian::WritableDatabase getwritedb_inmemory (const std::vector< std::string > &dbnames)
 Get a writable inmemory database instance.
Xapian::Database getdb_remoteprog (const std::vector< std::string > &dbnames)
 Get a remote database instance using xapian-progsrv.
Xapian::WritableDatabase getwritedb_remoteprog (const std::vector< std::string > &dbnames)
 Get a writable remote database instance using xapian-progsrv.
Xapian::Database getdb_remotetcp (const std::vector< std::string > &dbnames)
 Get a remote database instance using xapian-tcpsrv.
Xapian::WritableDatabase getwritedb_remotetcp (const std::vector< std::string > &dbnames)
 Get a writable remote database instance using xapian-tcpsrv.
std::string createdb_flint (const std::vector< std::string > &dbnames)
std::string createdb_quartz (const std::vector< std::string > &dbnames)

Private Member Functions

void index_files_to_database (Xapian::WritableDatabase &database, const std::vector< std::string > &dbnames)
 Index data from zero or more text files into a database.

Private Attributes

std::string datadir
 The current data directory.

Detailed Description

Definition at line 51 of file backendmanager.h.


Constructor & Destructor Documentation

BackendManager::BackendManager (  )  [inline]

Constructor - set up default state.

Definition at line 103 of file backendmanager.h.

virtual BackendManager::~BackendManager (  )  [inline, virtual]

Virtual methods, so virtual destructor.

Definition at line 106 of file backendmanager.h.


Member Function Documentation

void BackendManager::index_files_to_database ( Xapian::WritableDatabase database,
const std::vector< std::string > &  dbnames 
) [private]

Index data from zero or more text files into a database.

bool BackendManager::create_dir_if_needed ( const std::string &  dirname  )  [protected]

Xapian::WritableDatabase BackendManager::getwritedb_inmemory ( const std::vector< std::string > &  dbnames  )  [protected]

Get a writable inmemory database instance.

Xapian::Database BackendManager::getdb_remoteprog ( const std::vector< std::string > &  dbnames  )  [protected]

Get a remote database instance using xapian-progsrv.

Xapian::WritableDatabase BackendManager::getwritedb_remoteprog ( const std::vector< std::string > &  dbnames  )  [protected]

Get a writable remote database instance using xapian-progsrv.

Xapian::Database BackendManager::getdb_remotetcp ( const std::vector< std::string > &  dbnames  )  [protected]

Get a remote database instance using xapian-tcpsrv.

Xapian::WritableDatabase BackendManager::getwritedb_remotetcp ( const std::vector< std::string > &  dbnames  )  [protected]

Get a writable remote database instance using xapian-tcpsrv.

std::string BackendManager::createdb_flint ( const std::vector< std::string > &  dbnames  )  [protected]

Xapian::WritableDatabase BackendManager::getwritedb_flint ( const std::string &  name,
const std::vector< std::string > &  files 
)

Get a writable flint database instance.

std::string BackendManager::createdb_quartz ( const std::vector< std::string > &  dbnames  )  [protected]

Xapian::WritableDatabase BackendManager::getwritedb_quartz ( const std::string &  name,
const std::vector< std::string > &  files 
)

Get a writable quartz database instance.

virtual const char* BackendManager::get_dbtype (  )  const [inline, virtual]

Get the database type currently in use.

Current possible return values are "inmemory", "flint", "quartz", "none", "remoteprog", and "remotetcp".

Reimplemented in BackendManagerFlint, BackendManagerInMemory, BackendManagerMulti, BackendManagerQuartz, BackendManagerRemoteProg, and BackendManagerRemoteTcp.

Definition at line 113 of file backendmanager.h.

Referenced by get_dbtype(), get_writable_database_again(), and get_writable_database_as_database().

void BackendManager::set_datadir ( const std::string &  datadir_  )  [inline]

Set the directory to store data in.

Definition at line 117 of file backendmanager.h.

References datadir.

Referenced by main().

const std::string& BackendManager::get_datadir (  )  const [inline]

Get the directory to store data in.

Definition at line 121 of file backendmanager.h.

References datadir.

virtual Xapian::Database BackendManager::get_database ( const std::vector< std::string > &  dbnames  )  [virtual]

Get a database instance of the current type.

Reimplemented in BackendManagerFlint, BackendManagerInMemory, BackendManagerMulti, BackendManagerQuartz, BackendManagerRemoteProg, and BackendManagerRemoteTcp.

Referenced by get_database().

virtual Xapian::Database BackendManager::get_database ( const std::string &  dbname  )  [virtual]

Get a database instance of the current type, single file case.

Reimplemented in BackendManagerFlint, BackendManagerInMemory, BackendManagerMulti, BackendManagerQuartz, BackendManagerRemoteProg, and BackendManagerRemoteTcp.

virtual Xapian::WritableDatabase BackendManager::get_writable_database ( const std::string &  name,
const std::string &  file 
) [virtual]

Get a writable database instance.

Reimplemented in BackendManagerFlint, BackendManagerInMemory, BackendManagerMulti, BackendManagerQuartz, BackendManagerRemoteProg, and BackendManagerRemoteTcp.

Referenced by get_named_writable_database(), and get_writable_database().

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

Get a remote database instance with the specified timeout.

Reimplemented in BackendManagerRemoteProg, and BackendManagerRemoteTcp.

Referenced by get_remote_database().

Xapian::Database BackendManager::get_writable_database_as_database (  )  [virtual]

Create a Database object for the last opened WritableDatabase.

Reimplemented in BackendManagerFlint, BackendManagerQuartz, BackendManagerRemoteProg, and BackendManagerRemoteTcp.

Definition at line 206 of file backendmanager.cc.

References get_dbtype().

Referenced by get_writable_database_as_database().

Xapian::WritableDatabase BackendManager::get_writable_database_again (  )  [virtual]

Create a WritableDatabase object for the last opened WritableDatabase.

Reimplemented in BackendManagerFlint, BackendManagerQuartz, BackendManagerRemoteProg, and BackendManagerRemoteTcp.

Definition at line 215 of file backendmanager.cc.

References get_dbtype().

Referenced by get_writable_database_again().

const char * BackendManager::get_xapian_progsrv_command (  )  [static]

Get the command line required to run xapian-progsrv.

Definition at line 224 of file backendmanager.cc.

References XAPIAN_PROGSRV.

Referenced by DEFINE_TESTCASE().


Member Data Documentation

std::string BackendManager::datadir [private]

The current data directory.

Definition at line 53 of file backendmanager.h.

Referenced by get_datadir(), and set_datadir().


The documentation for this class was generated from the following files:
Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.