CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 namespace catapult {
namespace deltaset {
28 template<
typename TKeyTraits,
typename TStorageSet,
typename TMemorySet>
30 if (!deltas.
Added.empty())
31 elements.insert(deltas.
Added.cbegin(), deltas.
Added.cend());
33 for (
const auto& element : deltas.
Copied) {
34 auto iter = elements.find(TKeyTraits::ToKey(element));
35 if (elements.cend() == iter)
38 iter = elements.erase(iter);
39 elements.insert(iter, element);
42 for (
const auto& element : deltas.
Removed)
43 elements.erase(TKeyTraits::ToKey(element));
47 template<
typename TSetTraits>
51 UpdateSet<typename TSetTraits::KeyTraits>(elements, deltas);
static void Update(typename TSetTraits::SetType &elements, const DeltaElements< typename TSetTraits::MemorySetType > &deltas)
Applies all changes in deltas to elements.
Definition: BaseSetCommitPolicy.h:50
const TSet & Removed
Removed elements.
Definition: DeltaElements.h:47
const TSet & Added
Added elements.
Definition: DeltaElements.h:44
void UpdateSet(TStorageSet &elements, const DeltaElements< TMemorySet > &deltas)
Applies all changes in deltas to elements.
Definition: BaseSetCommitPolicy.h:29
Slim wrapper around changed elements.
Definition: DeltaElements.h:27
Default policy for committing changes to a base set.
Definition: BaseSetCommitPolicy.h:48
const TSet & Copied
Copied elements.
Definition: DeltaElements.h:50
#define CATAPULT_THROW_INVALID_ARGUMENT(MESSAGE)
Macro used to throw a catapult invalid argument.
Definition: exceptions.h:179
Definition: AddressExtractionExtension.cpp:28