xapian-core  1.4.27
progclient.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2010,2011,2014,2019 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef XAPIAN_INCLUDED_PROGCLIENT_H
22 #define XAPIAN_INCLUDED_PROGCLIENT_H
23 
24 #include <sys/types.h>
25 
27 
34 class ProgClient : public RemoteDatabase {
36  void operator=(const ProgClient &);
37 
39  ProgClient(const ProgClient &);
40 
41 #ifndef __WIN32__
42  pid_t child;
44 #else
45  HANDLE child;
47 #endif
48 
62  static int run_program(const std::string &progname,
63  const std::string &args,
64 #ifndef __WIN32__
65  pid_t& child
66 #else
67  HANDLE& child
68 #endif
69  );
70 
80  static std::string get_progcontext(const std::string &progname,
81  const std::string &args);
82 
83  public:
92  ProgClient(const std::string &progname,
93  const std::string &arg,
94  double timeout,
95  bool writable,
96  int flags);
97 
99  ~ProgClient();
100 };
101 
102 #endif // XAPIAN_INCLUDED_PROGCLIENT_H
RemoteDatabase is the baseclass for remote database implementations.
double timeout
The timeout value used in network communications, in seconds.
~ProgClient()
Destructor.
Definition: progclient.cc:258
ProgClient(const ProgClient &)
Don&#39;t allow copying.
Implementation of RemoteDatabase using a spawned server.
Definition: progclient.h:34
pid_t child
Process id of the child process.
Definition: progclient.h:43
void operator=(const ProgClient &)
Don&#39;t allow assignment.
static std::string get_progcontext(const std::string &progname, const std::string &args)
Generate context string for Xapian::Error exception objects.
Definition: progclient.cc:77
RemoteDatabase is the baseclass for remote database implementations.
static int run_program(const std::string &progname, const std::string &args, pid_t &child)
Start the child process.
Definition: progclient.cc:84