LCOV - code coverage report
Current view: top level - backends - dbfactory_remote.cc (source / functions) Hit Total Coverage
Test: Test Coverage for xapian-core r Lines: 8 8 100.0 %
Date: 2011-08-21 Functions: 4 4 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* dbfactory_remote.cc: Database factories for remote databases.
       2                 :            :  *
       3                 :            :  * Copyright (C) 2006,2007,2008,2010 Olly Betts
       4                 :            :  *
       5                 :            :  * This program is free software; you can redistribute it and/or
       6                 :            :  * modify it under the terms of the GNU General Public License as
       7                 :            :  * published by the Free Software Foundation; either version 2 of the
       8                 :            :  * License, or (at your option) any later version.
       9                 :            :  *
      10                 :            :  * This program is distributed in the hope that it will be useful,
      11                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      12                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      13                 :            :  * GNU General Public License for more details.
      14                 :            :  *
      15                 :            :  * You should have received a copy of the GNU General Public License
      16                 :            :  * along with this program; if not, write to the Free Software
      17                 :            :  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
      18                 :            :  */
      19                 :            : 
      20                 :            : #include <config.h>
      21                 :            : 
      22                 :            : #include <xapian/dbfactory.h>
      23                 :            : 
      24                 :            : #include "debuglog.h"
      25                 :            : #include "progclient.h"
      26                 :            : #include "remotetcpclient.h"
      27                 :            : 
      28                 :            : #include <string>
      29                 :            : 
      30                 :            : using namespace std;
      31                 :            : 
      32                 :            : namespace Xapian {
      33                 :            : 
      34                 :            : Database
      35                 :        564 : Remote::open(const string &host, unsigned int port, Xapian::timeout timeout,
      36                 :            :              Xapian::timeout connect_timeout)
      37                 :            : {
      38                 :            :     LOGCALL_STATIC(API, Database, "Remote::open", host | port | timeout | connect_timeout);
      39                 :            :     return Database(new RemoteTcpClient(host, port, timeout * 1e-3,
      40                 :        564 :                                         connect_timeout * 1e-3, false));
      41                 :            : }
      42                 :            : 
      43                 :            : WritableDatabase
      44                 :        207 : Remote::open_writable(const string &host, unsigned int port,
      45                 :            :                       Xapian::timeout timeout, Xapian::timeout connect_timeout)
      46                 :            : {
      47                 :            :     LOGCALL_STATIC(API, WritableDatabase, "Remote::open_writable", host | port | timeout | connect_timeout);
      48                 :            :     return WritableDatabase(new RemoteTcpClient(host, port, timeout * 1e-3,
      49                 :        207 :                             connect_timeout * 1e-3, true));
      50                 :            : }
      51                 :            : 
      52                 :            : Database
      53                 :        576 : Remote::open(const string &program, const string &args, Xapian::timeout timeout)
      54                 :            : {
      55                 :            :     LOGCALL_STATIC(API, Database, "Remote::open", program | args | timeout);
      56                 :        576 :     return Database(new ProgClient(program, args, timeout * 1e-3, false));
      57                 :            : }
      58                 :            : 
      59                 :            : WritableDatabase
      60                 :        207 : Remote::open_writable(const string &program, const string &args,
      61                 :            :                       Xapian::timeout timeout)
      62                 :            : {
      63                 :            :     LOGCALL_STATIC(API, WritableDatabase, "Remote::open_writable", program | args | timeout);
      64                 :        207 :     return WritableDatabase(new ProgClient(program, args, timeout * 1e-3, true));
      65                 :            : }
      66                 :            : 
      67                 :            : }

Generated by: LCOV version 1.8