LCOV - code coverage report
Current view: top level - backends/chert - chert_document.h (source / functions) Hit Total Coverage
Test: Test Coverage for xapian-core r Lines: 3 3 100.0 %
Date: 2011-08-21 Functions: 2 3 66.7 %
Branches: 1 4 25.0 %

           Branch data     Line data    Source code
       1                 :            : /** @file chert_document.h
       2                 :            :  * @brief A document read from a ChertDatabase.
       3                 :            :  */
       4                 :            : /* Copyright (C) 2008,2010 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_CHERT_DOCUMENT_H
      22                 :            : #define XAPIAN_INCLUDED_CHERT_DOCUMENT_H
      23                 :            : 
      24                 :            : #include "chert_record.h"
      25                 :            : #include "chert_values.h"
      26                 :            : #include "database.h"
      27                 :            : #include "document.h"
      28                 :            : 
      29                 :            : /// A document read from a ChertDatabase.
      30 [ +  - ][ #  # ]:     219840 : class ChertDocument : public Xapian::Document::Internal {
      31                 :            :     /// Don't allow assignment.
      32                 :            :     void operator=(const ChertDocument &);
      33                 :            : 
      34                 :            :     /// Don't allow copying.
      35                 :            :     ChertDocument(const ChertDocument &);
      36                 :            : 
      37                 :            :     /// Used for lazy access to document values.
      38                 :            :     const ChertValueManager *value_manager;
      39                 :            : 
      40                 :            :     /// Used for lazy access to document data.
      41                 :            :     const ChertRecordTable *record_table;
      42                 :            : 
      43                 :            :     /// ChertDatabase::open_document() needs to call our private constructor.
      44                 :            :     friend class ChertDatabase;
      45                 :            : 
      46                 :            :     /// Private constructor - only called by ChertDatabase::open_document().
      47                 :     219840 :     ChertDocument(Xapian::Internal::RefCntPtr<const Xapian::Database::Internal> db,
      48                 :            :                   Xapian::docid did_,
      49                 :            :                   const ChertValueManager *value_manager_,
      50                 :            :                   const ChertRecordTable *record_table_)
      51                 :            :         : Xapian::Document::Internal(db, did_),
      52                 :     219840 :           value_manager(value_manager_), record_table(record_table_) { }
      53                 :            : 
      54                 :            :   public:
      55                 :            :     /** Implementation of virtual methods @{ */
      56                 :            :     string do_get_value(Xapian::valueno slot) const;
      57                 :            :     void do_get_all_values(map<Xapian::valueno, string> & values_) const;
      58                 :            :     string do_get_data() const;
      59                 :            :     /** @} */
      60                 :            : };
      61                 :            : 
      62                 :            : #endif // XAPIAN_INCLUDED_CHERT_DOCUMENT_H

Generated by: LCOV version 1.8