CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
26 namespace catapult {
namespace state {
29 template<
typename T,
size_t N>
60 return !(*
this == rhs);
136 m_pArray = std::move(stack.m_pArray);
151 return const_iterator(
m_pArray.get(), 0);
155 const_iterator
end()
const {
156 return const_iterator(
m_pArray.get(), N);
184 m_pArray = std::make_unique<std::array<T, N>>();
205 for (
auto i = 0u; i < array.size() - 1; ++i)
206 array[i] = array[i + 1];
214 for (
auto i = array.size() - 1; i > 0; --i)
215 array[i] = array[i - 1];
const T & reference
Definition: CompactArrayStack.h:42
CompactArrayStack(const CompactArrayStack &stack)
Copy constructor that makes a deep copy of stack.
Definition: CompactArrayStack.h:113
const std::array< T, N > * m_pArray
Definition: CompactArrayStack.h:100
CompactArrayStack()
Creates an empty stack.
Definition: CompactArrayStack.h:109
const_iterator operator++(int)
Advances the iterator to the next position.
Definition: CompactArrayStack.h:74
const T value_type
Definition: CompactArrayStack.h:40
bool operator==(const const_iterator &rhs) const
Returns true if this iterator and rhs are equal.
Definition: CompactArrayStack.h:54
const T * pointer
Definition: CompactArrayStack.h:41
const T & peek() const
Returns a const reference to the element on the top of the stack.
Definition: CompactArrayStack.h:161
CompactArrayStack & operator=(CompactArrayStack &&stack)
Move assignment operator that assigns stack.
Definition: CompactArrayStack.h:135
CompactArrayStack & operator=(const CompactArrayStack &stack)
Assignment operator that makes a deep copy of stack.
Definition: CompactArrayStack.h:126
size_t m_size
Definition: CompactArrayStack.h:220
const_iterator begin() const
Returns a const iterator to the first element of the underlying container.
Definition: CompactArrayStack.h:150
size_t m_index
Definition: CompactArrayStack.h:101
#define CATAPULT_THROW_OUT_OF_RANGE(MESSAGE)
Macro used to throw a catapult out of range.
Definition: exceptions.h:191
void shiftLeft()
Definition: CompactArrayStack.h:200
void shiftRight()
Definition: CompactArrayStack.h:209
std::forward_iterator_tag iterator_category
Definition: CompactArrayStack.h:43
Compact array-based stack that allocates memory dynamically only when it is not empty.
Definition: CompactArrayStack.h:30
const_iterator & operator++()
Advances the iterator to the next position.
Definition: CompactArrayStack.h:65
const_iterator end() const
Returns a const iterator to the element following the last element of the underlying container.
Definition: CompactArrayStack.h:155
void push(const T &value)
Pushes value onto the stack.
Definition: CompactArrayStack.h:178
T & peek()
Returns a reference to the element on the top of the stack.
Definition: CompactArrayStack.h:169
pointer operator->() const
Returns a pointer to the current value.
Definition: CompactArrayStack.h:87
T m_defaultValue
Definition: CompactArrayStack.h:102
Definition: AddressExtractionExtension.cpp:28
reference operator*() const
Returns a reference to the current value.
Definition: CompactArrayStack.h:82
void pop()
Pops the top value from the stack.
Definition: CompactArrayStack.h:190
CompactArrayStack(CompactArrayStack &&stack)
Move constructor that move constructs a stack from stack.
Definition: CompactArrayStack.h:118
bool isEnd() const
Definition: CompactArrayStack.h:95
std::ptrdiff_t difference_type
Definition: CompactArrayStack.h:39
const_iterator(const std::array< T, N > *pArray, size_t index)
Creates an iterator around pArray with index current position.
Definition: CompactArrayStack.h:47
std::unique_ptr< std::array< T, N > > m_pArray
Definition: CompactArrayStack.h:219
bool operator!=(const const_iterator &rhs) const
Returns true if this iterator and rhs are not equal.
Definition: CompactArrayStack.h:59
size_t size() const
Gets number of non-default values contained in the stack.
Definition: CompactArrayStack.h:144
Definition: CompactArrayStack.h:37