HCE project C++ developers source code library  1.1.1
HCE project developer library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SphinxTaskReducersStorage.cpp
Go to the documentation of this file.
2 
3 namespace HCE{
4 namespace sphinx{
5 namespace reduce_task{
6 
8 
10 
11 Poco::SharedPtr<SphinxTaskReducerIf>SphinxTaskReducersStorage::
12  findByKey (unsigned long long taskId)
13 {
14  StorageIterator storageIterator = findIteratorBy(taskId);
15  return storageIterator->second;
16 }
17 
18 void SphinxTaskReducersStorage::deleteByKey(unsigned long long taskId)
19 {
20  StorageIterator storageIterator = findIteratorBy(taskId);
21  storage.erase(storageIterator);
22 }
23 
24 void SphinxTaskReducersStorage::addWithKey(unsigned long long taskId,
25  Poco::SharedPtr<SphinxTaskReducerIf>& sphinxTaskReducer)
26 {
27  storage.insert(std::make_pair(taskId, sphinxTaskReducer));
28 }
29 
30 SphinxTaskReducersStorage::StorageIterator SphinxTaskReducersStorage::
31  findIteratorBy(unsigned long long taskId)
32 {
33  StorageIterator storageIterator = storage.find(taskId);
34  if (storageIterator != storage.end()){
35  return storageIterator;
36  }
38  ("SphinxTaskReducersStorage - not found key " + std::to_string(taskId));
39 }
40 
41 }
42 }
43 }