OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ScoreBoard.hpp
Go to the documentation of this file.
1 #ifndef __OPENTREP_BOM_SCOREBOARD_HPP
2 #define __OPENTREP_BOM_SCOREBOARD_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <map>
9 // OpenTrep
13 // Xapian
14 #include <xapian.h>
15 
16 namespace OPENTREP {
17 
22  struct ScoreBoard : public StructAbstract {
23  public:
24  // //////////////// Type definitions /////////////////
28  typedef std::map<ScoreType::EN_ScoreType, Score_T> ScoreMap_T;
29 
30 
31  public:
32  // ////////////////// Getters ////////////////
36  const TravelQuery_T& getQueryString() const {
37  return _queryString;
38  }
39 
43  const ScoreMap_T& getScoreMap() const {
44  return _scoreMap;
45  }
46 
51  Score_T getScore (const ScoreType&) const;
52 
58  }
59 
60 
61  public:
62  // //////////////////// Setters //////////////////
66  void setQueryString (const TravelQuery_T& iQueryString) {
67  _queryString = iQueryString;
68  }
69 
98  void setScore (const ScoreType&, const Score_T&);
99 
103  void setCombinedWeight (const Score_T& iScore) {
105  }
106 
113 
114 
115  public:
116  // //////////////// Business methods ////////////////
117 
118 
119  public:
120  // /////////// Display support methods /////////
126  void toStream (std::ostream&) const;
127 
133  void fromStream (std::istream&);
134 
140  std::string describeKey() const;
141 
147  std::string describe() const;
148 
149 
150  public:
151  // //////////////// Constructors and Destructors /////////////
155  ScoreBoard (const TravelQuery_T&, const ScoreType&, const Score_T&);
156 
160  ScoreBoard (const TravelQuery_T&);
161 
165  ScoreBoard (const ScoreBoard&);
166 
170  ~ScoreBoard();
171 
172 
173  private:
174  // ///////////////// Attributes //////////////////
178  TravelQuery_T _queryString;
179 
183  ScoreMap_T _scoreMap;
184  };
185 
186 }
187 #endif // __OPENTREP_BOM_SCOREBOARD_HPP
void toStream(std::ostream &) const
Definition: ScoreBoard.cpp:177
Structure holding a board for all the types of score/matching having been performed.
Definition: ScoreBoard.hpp:22
void setCombinedWeight(const Score_T &iScore)
Definition: ScoreBoard.hpp:103
Score_T getScore(const ScoreType &) const
Definition: ScoreBoard.cpp:40
double Percentage_T
double Score_T
void setQueryString(const TravelQuery_T &iQueryString)
Definition: ScoreBoard.hpp:66
const TravelQuery_T & getQueryString() const
Definition: ScoreBoard.hpp:36
Score_T getCombinedWeight() const
Definition: ScoreBoard.hpp:56
ScoreBoard(const TravelQuery_T &, const ScoreType &, const Score_T &)
Definition: ScoreBoard.cpp:28
Percentage_T calculateCombinedWeight()
Definition: ScoreBoard.cpp:186
Base class for the light structures.
std::string describeKey() const
Definition: ScoreBoard.cpp:150
std::map< ScoreType::EN_ScoreType, Score_T > ScoreMap_T
Definition: ScoreBoard.hpp:28
Enumeration of score types.
Definition: ScoreType.hpp:25
void setScore(const ScoreType &, const Score_T &)
Definition: ScoreBoard.cpp:54
std::string describe() const
Definition: ScoreBoard.cpp:157
std::string TravelQuery_T
void fromStream(std::istream &)
Definition: ScoreBoard.cpp:182
const ScoreMap_T & getScoreMap() const
Definition: ScoreBoard.hpp:43