OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
ResultHolder.hpp
Go to the documentation of this file.
1#ifndef __OPENTREP_BOM_RESULTHOLDER_HPP
2#define __OPENTREP_BOM_RESULTHOLDER_HPP
3
4// //////////////////////////////////////////////////////////////////////
5// Import section
6// //////////////////////////////////////////////////////////////////////
7// OpenTrep
11
12// Forward declarations
13namespace Xapian {
14 class Database;
15}
16
17namespace OPENTREP {
18
19 // Forward declarations
21 struct StringSet;
22
26 class ResultHolder : public BomAbstract {
28 friend class FacResultHolder;
29 public:
30 // ////////////////////// Getters /////////////////////
35 return _queryString;
36 }
37
41 const ResultList_T& getResultList() const {
42 return _resultList;
43 }
44
49 return _combinedWeight;
50 }
51
56
57
58 public:
59 // ////////////////////// Setters /////////////////////
63 void setCombinedWeight (const Percentage_T& iPercentage) {
64 _combinedWeight = iPercentage;
65 }
66
67
68 public:
69 // /////////// Business methods ///////////
73 void displayXapianPercentages() const;
74
78 void calculateEnvelopeWeights() const;
79
84 void calculateCodeMatches() const;
85
89 void calculatePageRanks() const;
90
94 void calculateHeuristicWeights() const;
95
100
101
102 public:
103 // /////////// Display support methods /////////
109 void toStream (std::ostream&) const;
110
116 void fromStream (std::istream&);
117
121 std::string toString() const;
122
127 std::string describeKey() const;
128
133 std::string describeShortKey() const;
134
135
136 private:
137 // ////////////// Constructors and Destructors /////////////
141 ResultHolder (const TravelQuery_T&, const Xapian::Database&);
145 ResultHolder();
149 ResultHolder (const ResultHolder&);
157 void init();
158
159
160 private:
161 // /////////////// Attributes ////////////////
165 ResultCombination* _resultCombination;
166
170 const TravelQuery_T _queryString;
171
175 const Xapian::Database& _database;
176
180 ResultList_T _resultList;
181
185 Percentage_T _combinedWeight;
186 };
187
188}
189#endif // __OPENTREP_BOM_RESULTHOLDER_HPP
Class wrapping functions on a list of ResultHolder objects.
Class wrapping functions on a list of Result objects.
void fromStream(std::istream &)
std::string describeShortKey() const
StringSet getCorrectedStringSet() const
void calculateEnvelopeWeights() const
const ResultList_T & getResultList() const
friend class FacResultCombination
std::string describeKey() const
void toStream(std::ostream &) const
void calculateCodeMatches() const
friend class FacResultHolder
void calculatePageRanks() const
void calculateHeuristicWeights() const
void setCombinedWeight(const Percentage_T &iPercentage)
const Percentage_T & getCombinedWeight() const
const TravelQuery_T & getQueryString() const
std::string toString() const
void displayXapianPercentages() const
std::string TravelQuery_T
double Percentage_T
std::list< Result * > ResultList_T
Class holding a set of strings, e.g., {"rio", "de", "janeiro"}.
Definition StringSet.hpp:19