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
ReduceAdditionsStorage.cpp
Go to the documentation of this file.
2 
3 namespace HCE{
4 namespace reduce{
5 
7 
9 
10 Poco::SharedPtr<additions::TaskReducersManagerIf>ReduceAdditionsStorage::findBy
12 {
13  StorageIterator storageIterator = findIteratorBy(key);
14  return storageIterator->second;
15 }
16 
17 Poco::SharedPtr<additions::TaskReducersManagerIf>ReduceAdditionsStorage::findBy
18  (unsigned long long secondKey)
19 {
20  SecondKeyStorageIterator storageIterator = findIteratorBy(secondKey);
21  return storageIterator->second;
22 }
23 
24 void ReduceAdditionsStorage::deleteBy(unsigned long long secondKey)
25 {
26  SecondKeyStorageIterator storageIterator = findIteratorBy(secondKey);
27  _secondKeyStorage.erase(storageIterator);
28 }
29 
31  Poco::SharedPtr<additions::TaskReducersManagerIf> taskReducersManager)
32 {
33  _storage.insert(std::make_pair(key, taskReducersManager));
34 }
35 
36 void ReduceAdditionsStorage::addWith(unsigned long long secondKey,
37  Poco::SharedPtr<additions::TaskReducersManagerIf> taskReducersManager)
38 {
39  _secondKeyStorage.insert(std::make_pair(secondKey, taskReducersManager));
40 }
41 
42 
43 ReduceAdditionsStorage::StorageIterator ReduceAdditionsStorage::findIteratorBy
45 {
46  StorageIterator storageIterator = _storage.find(key);
47  if (storageIterator != _storage.end()){
48  return storageIterator;
49  }
51  ("ReduceAdditionsStorage - not found key " +
52  std::to_string(static_cast<int>(key)));
53 }
54 
55 ReduceAdditionsStorage::SecondKeyStorageIterator ReduceAdditionsStorage::findIteratorBy
56  (unsigned long long key)
57 {
58  SecondKeyStorageIterator storageIterator = _secondKeyStorage.find(key);
59  if (storageIterator != _secondKeyStorage.end()){
60  return storageIterator;
61  }
63  ("ReduceAdditionsStorage - not found key " + std::to_string(key));
64 }
65 
66 
67 }
68 }