Branch data Line data Source code
1 : : /** @file brass_document.h
2 : : * @brief A document read from a BrassDatabase.
3 : : */
4 : : /* Copyright (C) 2008,2009,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_BRASS_DOCUMENT_H
22 : : #define XAPIAN_INCLUDED_BRASS_DOCUMENT_H
23 : :
24 : : #include "brass_record.h"
25 : : #include "brass_values.h"
26 : : #include "database.h"
27 : : #include "document.h"
28 : :
29 : : /// A document read from a BrassDatabase.
30 [ + - ][ # # ]: 219833 : class BrassDocument : public Xapian::Document::Internal {
31 : : /// Don't allow assignment.
32 : : void operator=(const BrassDocument &);
33 : :
34 : : /// Don't allow copying.
35 : : BrassDocument(const BrassDocument &);
36 : :
37 : : /// Used for lazy access to document values.
38 : : const BrassValueManager *value_manager;
39 : :
40 : : /// Used for lazy access to document data.
41 : : const BrassRecordTable *record_table;
42 : :
43 : : /// BrassDatabase::open_document() needs to call our private constructor.
44 : : friend class BrassDatabase;
45 : :
46 : : /// Private constructor - only called by BrassDatabase::open_document().
47 : 219833 : BrassDocument(Xapian::Internal::RefCntPtr<const Xapian::Database::Internal> db,
48 : : Xapian::docid did_,
49 : : const BrassValueManager *value_manager_,
50 : : const BrassRecordTable *record_table_)
51 : : : Xapian::Document::Internal(db, did_),
52 : 219833 : 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_BRASS_DOCUMENT_H
|