hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SphinxReduceDataStorage.cpp
Go to the documentation of this file.
2 
3 namespace HCE{
4 namespace sphinx{
5 namespace reduce_task{
6 
8 
10 
12 {
13  if (_keyValueIterator != _data.end()){
14  return true;
15  }
16  return false;
17 }
18 
20 {
21  _keyValueIterator = _data.begin();
22 }
23 
24 void SphinxReduceDataStorage::getNext(std::string & key, std::string& value)
25 {
26  key = std::to_string(_keyValueIterator->second.getDocId());
27  value = _keyValueIterator->second.getWeight();
28  ++_keyValueIterator;
29 }
30 
32 {
33  std::string complexKey = std::to_string(sphinxMatchInfo.getDocId()) +
34  sphinxMatchInfo.getWeight();
35  _data.insert(std::make_pair(complexKey, sphinxMatchInfo));
36 }
37 
39  getData(const std::string& key)
40 {
41  return _data.equal_range(key);
42 }
43 
44 }
45 }
46 }