xapian-core  1.4.21
backendmanager_multi.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2009,2017,2018,2019,2020 Olly Betts
5  * Copyright (C) 2008 Lemur Consulting Ltd
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef XAPIAN_INCLUDED_BACKENDMANAGER_MULTI_H
23 #define XAPIAN_INCLUDED_BACKENDMANAGER_MULTI_H
24 
25 #include "backendmanager.h"
26 
27 #include <string>
28 #include <vector>
29 
30 #include <xapian/database.h>
31 
35  void operator=(const BackendManagerMulti &);
36 
39 
41  std::string last_wdb_path;
42 
43  // vector of sub_managers.
44  std::vector<BackendManager*> sub_managers;
45 
46  std::string cachedir;
47 
48  std::string createdb_multi(const std::string& name,
49  const std::vector<std::string>& files);
50 
51  protected:
53  std::string do_get_database_path(const std::vector<std::string> & files);
54 
55  public:
56  BackendManagerMulti(const std::string& datadir_,
57  std::vector<BackendManager*> sub_manager_);
58 
60  std::string get_dbtype() const;
61 
62  Xapian::Database get_remote_database(const std::vector<std::string>& files,
63  unsigned int timeout);
64 
66  Xapian::WritableDatabase get_writable_database(const std::string & name, const std::string & file);
67 
69  std::string get_writable_database_path(const std::string & name);
70 
71  std::string get_compaction_output_path(const std::string& name);
72 
73  std::string get_generated_database_path(const std::string& name);
74 
77 
80 };
81 
82 #endif // XAPIAN_INCLUDED_BACKENDMANAGER_MULTI_H
This class is used to access a database, or a group of databases.
Definition: database.h:68
unsigned timeout
A timeout value in milliseconds.
Definition: types.h:100
Xapian::WritableDatabase get_writable_database_again()
Create a WritableDatabase object for the last opened WritableDatabase.
std::string last_wdb_path
The path of the last writable database used.
std::string get_writable_database_path(const std::string &name)
Get the path of Xapian::WritableDatabase instance.
std::string get_generated_database_path(const std::string &name)
Get the path to use for generating a database, if supported.
std::string createdb_multi(const std::string &name, const std::vector< std::string > &files)
Base class for backend handling in test harness.
This class provides read/write access to a database.
Definition: database.h:785
std::string get_compaction_output_path(const std::string &name)
Get a path to compact a database to.
API for working with Xapian databases.
std::string get_writable_database_path_again()
Get the path of the last opened WritableDatabase.
std::vector< BackendManager * > sub_managers
Xapian::Database get_remote_database(const std::vector< std::string > &files, unsigned int timeout)
Get a remote database instance with the specified timeout.
std::string get_dbtype() const
Return a string representing the current database type.
BackendManager subclass for multi databases.
void operator=(const BackendManagerMulti &)
Don&#39;t allow assignment.
Xapian::WritableDatabase get_writable_database(const std::string &name, const std::string &file)
Create a Multi Xapian::WritableDatabase object indexing a single file.
std::string do_get_database_path(const std::vector< std::string > &files)
Get the path of the Xapian::Database instance.
Definition: header.h:151
BackendManagerMulti(const BackendManagerMulti &)
Don&#39;t allow copying.