CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 namespace catapult {
namespace deltaset {
29 template<
typename TSetTraits>
30 class BaseSetDeltaIterationView {
32 using SetType =
typename TSetTraits::MemorySetType;
33 using KeyType =
typename TSetTraits::KeyType;
48 using value_type =
const typename TSetTraits::StorageType;
78 return !(*
this == rhs);
131 const auto& key = TSetTraits::ToKey(*
m_iter);
142 const auto& key = TSetTraits::ToKey(*
m_iter);
152 return set.cend() != set.find(key);
199 template<
typename TElementTraits,
typename TSetTraits>
std::ptrdiff_t difference_type
Definition: BaseSetDeltaIterationView.h:47
void moveToValidElement()
Definition: BaseSetDeltaIterationView.h:101
size_t m_size
Definition: BaseSetDeltaIterationView.h:194
value_type & operator*() const
Returns a reference to the current element.
Definition: BaseSetDeltaIterationView.h:165
iterator operator++(int)
Advances the iterator to the next position.
Definition: BaseSetDeltaIterationView.h:94
size_t m_position
Definition: BaseSetDeltaIterationView.h:175
SetType::const_iterator m_iter
Definition: BaseSetDeltaIterationView.h:178
const SetType & m_originalElements
Definition: BaseSetDelta.h:359
size_t m_size
Definition: BaseSetDeltaIterationView.h:176
const TSet & Removed
Removed elements.
Definition: DeltaElements.h:47
const TSet & Added
Added elements.
Definition: DeltaElements.h:44
BaseSetDeltaIterationView(const SetType &originalElements, const DeltaElements< SetType > &deltas, size_t size)
Creates a view around originalElements, deltas and size.
Definition: BaseSetDeltaIterationView.h:37
Iterator used for iterating over the view.
Definition: BaseSetDeltaIterationView.h:45
value_type * pointer
Definition: BaseSetDeltaIterationView.h:49
bool operator==(const iterator &rhs) const
Returns true if this iterator and rhs are equal.
Definition: BaseSetDeltaIterationView.h:70
const TSet & SelectIterableSet(const TSet &set)
Selects the iterable set from set.
Definition: BaseSetIterationView.h:67
bool handleAddedStage()
Definition: BaseSetDeltaIterationView.h:139
iterator & operator++()
Advances the iterator to the next position.
Definition: BaseSetDeltaIterationView.h:83
#define CATAPULT_THROW_OUT_OF_RANGE(MESSAGE)
Macro used to throw a catapult out of range.
Definition: exceptions.h:191
value_type * operator->() const
Returns a pointer to the current element.
Definition: BaseSetDeltaIterationView.h:157
Definition: BaseSetDelta.h:67
uint64_t size
Definition: MemoryCounters.cpp:65
const typename TSetTraits::StorageType value_type
Definition: BaseSetDeltaIterationView.h:48
iterator(const SetType &elements, const DeltaElements< SetType > &deltas, size_t position, size_t size)
Creates an iterator around the original elements and deltas at position given a total of size element...
Definition: BaseSetDeltaIterationView.h:55
DeltaElements< SetType > m_deltas
Definition: BaseSetDeltaIterationView.h:193
size_t size() const
Gets the size of this set.
Definition: BaseSetDelta.h:108
DeltaElements< MemorySetType > deltas() const
Gets const references to the pending modifications.
Definition: BaseSetDelta.h:304
bool operator!=(const iterator &rhs) const
Returns true if this iterator and rhs are not equal.
Definition: BaseSetDeltaIterationView.h:77
IterationStage m_stage
Definition: BaseSetDeltaIterationView.h:177
auto end() const
Returns a const iterator to the element following the last element of the underlying set.
Definition: BaseSetDeltaIterationView.h:187
const SetType & m_elements
Definition: BaseSetDeltaIterationView.h:173
typename TSetTraits::KeyType KeyType
Definition: BaseSetDeltaIterationView.h:33
std::forward_iterator_tag iterator_category
Definition: BaseSetDeltaIterationView.h:51
const TSet & Copied
Copied elements.
Definition: DeltaElements.h:50
auto begin() const
Returns a const iterator to the first element of the underlying set.
Definition: BaseSetDeltaIterationView.h:182
typename TSetTraits::MemorySetType SetType
Definition: BaseSetDeltaIterationView.h:32
value_type & reference
Definition: BaseSetDeltaIterationView.h:50
IterationStage
Definition: BaseSetDeltaIterationView.h:170
Definition: AddressExtractionExtension.cpp:28
BaseSetDeltaIterationView< TSetTraits > MakeIterableView(const BaseSetDelta< TElementTraits, TSetTraits > &delta)
Definition: BaseSetDeltaIterationView.h:200
bool handleOriginalStage()
Definition: BaseSetDeltaIterationView.h:128
static constexpr bool Contains(const SetType &set, const KeyType &key)
Definition: BaseSetDeltaIterationView.h:151
DeltaElements< SetType > m_deltas
Definition: BaseSetDeltaIterationView.h:174
bool handleCopiedStage()
Definition: BaseSetDeltaIterationView.h:124
const SetType & m_originalElements
Definition: BaseSetDeltaIterationView.h:192