LCOV - code coverage report
Current view: top level - backends/remote - remote-document.h (source / functions) Hit Total Coverage
Test: Test Coverage for xapian-core 954b5873a738 Lines: 4 4 100.0 %
Date: 2019-06-30 05:20:33 Functions: 2 2 100.0 %
Branches: 1 2 50.0 %

           Branch data     Line data    Source code
       1                 :            : /** @file remote-document.h
       2                 :            :  * @brief A document read from a RemoteDatabase.
       3                 :            :  */
       4                 :            : /* Copyright (C) 2008,2011 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_REMOTE_DOCUMENT_H
      22                 :            : #define XAPIAN_INCLUDED_REMOTE_DOCUMENT_H
      23                 :            : 
      24                 :            : #include "backends/databaseinternal.h"
      25                 :            : #include "backends/documentinternal.h"
      26                 :            : 
      27                 :            : /// A document read from a RemoteDatabase.
      28         [ -  + ]:     919840 : class RemoteDocument : public Xapian::Document::Internal {
      29                 :            :     /// Don't allow assignment.
      30                 :            :     void operator=(const RemoteDocument &);
      31                 :            : 
      32                 :            :     /// Don't allow copying.
      33                 :            :     RemoteDocument(const RemoteDocument &);
      34                 :            : 
      35                 :            :     /// RemoteDocument::open_document() needs to call our private constructor.
      36                 :            :     friend class RemoteDatabase;
      37                 :            : 
      38                 :            :     /** Private constructor - only called by RemoteDatabase::open_document().
      39                 :            :      *
      40                 :            :      *  @param values_  The values to set - passed by non-const reference, and
      41                 :            :      *                  may be modified by the call.
      42                 :            :      */
      43                 :     229960 :     RemoteDocument(const Xapian::Database::Internal *db, Xapian::docid did_,
      44                 :            :                    string&& data_,
      45                 :            :                    map<Xapian::valueno, string>&& values_)
      46                 :     229960 :         : Xapian::Document::Internal(db, did_, std::move(data_),
      47                 :     459920 :                                      std::move(values_)) {}
      48                 :            : 
      49                 :            :   protected:
      50                 :            :     /** Implementation of virtual methods @{ */
      51                 :            :     string fetch_value(Xapian::valueno slot) const;
      52                 :            :     void fetch_all_values(map<Xapian::valueno, string> & values_) const;
      53                 :            :     string fetch_data() const;
      54                 :            :     /** @} */
      55                 :            : };
      56                 :            : 
      57                 :            : #endif // XAPIAN_INCLUDED_REMOTE_DOCUMENT_H

Generated by: LCOV version 1.11