Test harness refactor
[xapian.git] / xapian-core / tests / harness / backendmanager_remotetcp.h
blobea436f7531dc956dd057bf6e32e9df122fdb0792
1 /** @file backendmanager_remotetcp.h
2 * @brief BackendManager subclass for remotetcp databases.
3 */
4 /* Copyright (C) 2007,2009,2011 Olly Betts
5 * Copyright (C) 2008 Lemur Consulting Ltd
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.
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.
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
22 #ifndef XAPIAN_INCLUDED_BACKENDMANAGER_REMOTETCP_H
23 #define XAPIAN_INCLUDED_BACKENDMANAGER_REMOTETCP_H
25 #include "backendmanager.h"
26 #include "backendmanager_remote.h"
28 #include <string>
30 /// BackendManager subclass for remotetcp databases.
31 class BackendManagerRemoteTcp : public BackendManagerRemote {
32 /// Don't allow assignment.
33 void operator=(const BackendManagerRemoteTcp &);
35 /// Don't allow copying.
36 BackendManagerRemoteTcp(const BackendManagerRemoteTcp &);
38 /// The path of the last writable database used.
39 std::string last_wdb_name;
41 /// Create a Xapian::Database object indexing multiple files.
42 Xapian::Database do_get_database(const std::vector<std::string> & files);
44 public:
45 explicit BackendManagerRemoteTcp(BackendManager* sub_manager_)
46 : BackendManagerRemote(sub_manager_) { }
48 ~BackendManagerRemoteTcp();
50 /// Return a string representing the current database type.
51 std::string get_dbtype() const;
53 /// Create a RemoteTcp Xapian::WritableDatabase object indexing a single file.
54 Xapian::WritableDatabase get_writable_database(const std::string & name,
55 const std::string & file);
57 /// Create a RemoteTcp Xapian::Database with the specified timeout.
58 Xapian::Database get_remote_database(const std::vector<std::string> & files,
59 unsigned int timeout);
61 /// Create a Database object for the last opened WritableDatabase.
62 Xapian::Database get_writable_database_as_database();
64 /// Create a WritableDatabase object for the last opened WritableDatabase.
65 Xapian::WritableDatabase get_writable_database_again();
67 /// Called after each test, to perform any necessary cleanup.
68 void clean_up();
71 #endif // XAPIAN_INCLUDED_BACKENDMANAGER_REMOTETCP_H