CatapultServer  v0.5.0.1 (Elephant)
ArraySet.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "Hashers.h"
23 #include "catapult/types.h"
24 #include <set>
25 #include <unordered_map>
26 #include <unordered_set>
27 
28 namespace catapult { namespace utils {
29 
31  template<typename TArray>
33  size_t operator()(const TArray* pArray) const {
34  return ArrayHasher<TArray>()(*pArray);
35  }
36  };
37 
39  template<typename TArray>
41  bool operator()(const TArray* pLhs, const TArray* pRhs) const {
42  return *pLhs == *pRhs;
43  }
44  };
45 
47  template<typename TArray>
48  using ArraySet = std::unordered_set<TArray, ArrayHasher<TArray>>;
49 
51  template<typename TArray>
52  using ArrayPointerSet = std::unordered_set<const TArray*, ArrayPointerHasher<TArray>, ArrayPointerEquality<TArray>>;
53 
55  template<typename TArray>
56  using ArrayPointerFlagMap = std::unordered_map<const TArray*, bool, ArrayPointerHasher<TArray>, ArrayPointerEquality<TArray>>;
57 
58  // region well known array sets
59 
62 
65 
67  using SortedKeySet = std::set<Key>;
68 
71 
74 
75  // endregion
76 }}
catapult::utils::ArrayPointerHasher::operator()
size_t operator()(const TArray *pArray) const
Definition: ArraySet.h:33
catapult::utils::ArraySet
std::unordered_set< TArray, ArrayHasher< TArray > > ArraySet
A set of arrays.
Definition: ArraySet.h:48
catapult::utils::SortedKeySet
std::set< Key > SortedKeySet
A sorted key set.
Definition: ArraySet.h:67
catapult::utils::ArrayPointerFlagMap
std::unordered_map< const TArray *, bool, ArrayPointerHasher< TArray >, ArrayPointerEquality< TArray > > ArrayPointerFlagMap
A map of array pointers to flags.
Definition: ArraySet.h:56
catapult::utils::ArrayPointerHasher
Functor for hashing an array pointer.
Definition: ArraySet.h:32
catapult::utils::ArrayPointerEquality
Functor for comparing two array pointers.
Definition: ArraySet.h:40
catapult::utils::KeySet
ArraySet< Key > KeySet
A key set.
Definition: ArraySet.h:64
catapult::utils::HashSet
ArraySet< Hash256 > HashSet
A hash set.
Definition: ArraySet.h:61
types.h
catapult::utils::KeyPointerSet
ArrayPointerSet< Key > KeyPointerSet
A key pointer set.
Definition: ArraySet.h:73
catapult
Definition: AddressExtractionExtension.cpp:28
Hashers.h
catapult::utils::ArrayPointerSet
std::unordered_set< const TArray *, ArrayPointerHasher< TArray >, ArrayPointerEquality< TArray > > ArrayPointerSet
A set of array pointers.
Definition: ArraySet.h:52
catapult::utils::HashPointerSet
ArrayPointerSet< Hash256 > HashPointerSet
A hash pointer set.
Definition: ArraySet.h:70
catapult::utils::ArrayPointerEquality::operator()
bool operator()(const TArray *pLhs, const TArray *pRhs) const
Definition: ArraySet.h:41
catapult::utils::ArrayHasher< TArray >