1 /////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
5 /////////////////////////////////////////////////////////////////////////////
6 
7 #ifndef FORMATPOSTINGSFIELDSCONSUMER_H
8 #define FORMATPOSTINGSFIELDSCONSUMER_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene {
13 
14 /// Abstract API that consumes terms, doc, freq, prox and payloads postings.  Concrete implementations of this
15 /// actually do "something" with the postings (write it into the index in a specific format).
16 class FormatPostingsFieldsConsumer : public LuceneObject {
17 public:
18     virtual ~FormatPostingsFieldsConsumer();
19 
20     LUCENE_CLASS(FormatPostingsFieldsConsumer);
21 
22 public:
23     /// Add a new field.
24     virtual FormatPostingsTermsConsumerPtr addField(const FieldInfoPtr& field) = 0;
25 
26     /// Called when we are done adding everything.
27     virtual void finish() = 0;
28 };
29 
30 }
31 
32 #endif
33