CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 namespace catapult {
namespace model {
38 template<
typename TEntity>
68 template<
typename TIteratorEntity>
80 return reinterpret_cast<uint8_t*>(pEntity);
85 return reinterpret_cast<const uint8_t*>(pEntity);
89 return reinterpret_cast<value_type*>(
ToBytePointer(pEntity) + numBytes);
109 return !(*
this == rhs);
213 template<
typename TEntity>
constexpr BasicContiguousEntityContainer< TEntity > MakeContiguousEntityContainer(TEntity *pEntity, size_t size, EntityContainerErrorPolicy errorPolicy=EntityContainerErrorPolicy::Throw)
Definition: ContiguousEntityContainer.h:214
EntityContainerErrorPolicy
Polcies for handling iteration errors.
Definition: ContiguousEntityContainer.h:28
void checkError()
Definition: ContiguousEntityContainer.h:163
constexpr BasicContiguousEntityContainer(TEntity *pEntity, size_t entitiesSize, EntityContainerErrorPolicy errorPolicy)
Definition: ContiguousEntityContainer.h:46
auto begin() const
Returns an iterator that represents the first entity.
Definition: ContiguousEntityContainer.h:191
Actual iterator.
Definition: ContiguousEntityContainer.h:69
static constexpr auto ToBytePointer(T *pEntity)
Definition: ContiguousEntityContainer.h:79
bool operator==(const iterator &rhs) const
Returns true if this iterator and rhs are equal.
Definition: ContiguousEntityContainer.h:103
TEntity value_type
Definition: ContiguousEntityContainer.h:41
Immediately throw when an iteration error is encounted.
Definition: ContiguousEntityContainer.h:39
constexpr bool isEntityInBuffer(value_type *pEntity) const noexcept
Definition: ContiguousEntityContainer.h:148
bool HasError
Definition: ContiguousEntityContainer.h:56
auto end() const
Returns an iterator that represents one past the last entity.
Definition: ContiguousEntityContainer.h:196
bool operator!=(const iterator &rhs) const
Returns true if this iterator and rhs are not equal.
Definition: ContiguousEntityContainer.h:108
value_type * m_pCurrent
Definition: ContiguousEntityContainer.h:175
TEntity * m_pStart
Definition: ContiguousEntityContainer.h:207
std::ptrdiff_t difference_type
Definition: ContiguousEntityContainer.h:71
#define CATAPULT_THROW_OUT_OF_RANGE(MESSAGE)
Macro used to throw a catapult out of range.
Definition: exceptions.h:191
iterator operator++(int)
Advances the iterator to the next position.
Definition: ContiguousEntityContainer.h:127
State & m_state
Definition: ContiguousEntityContainer.h:176
iterator & operator++()
Advances the iterator to the next position.
Definition: ContiguousEntityContainer.h:114
iterator(value_type *pStart, value_type *pCurrent, State &state)
Creates an iterator around pStart and state with specified current position (pCurrent).
Definition: ContiguousEntityContainer.h:94
static constexpr auto Advance(value_type *pEntity, size_t numBytes)
Definition: ContiguousEntityContainer.h:88
TIteratorEntity * pointer
Definition: ContiguousEntityContainer.h:73
uint64_t size
Definition: MemoryCounters.cpp:65
value_type * m_pStart
Definition: ContiguousEntityContainer.h:174
reference operator*() const
Returns a reference to the current entity.
Definition: ContiguousEntityContainer.h:135
const size_t Size
Definition: ContiguousEntityContainer.h:54
TIteratorEntity value_type
Definition: ContiguousEntityContainer.h:72
const bool ThrowOnError
Definition: ContiguousEntityContainer.h:55
auto cend() const
Returns a const iterator that represents one past the last entity.
Definition: ContiguousEntityContainer.h:186
#define CATAPULT_THROW_RUNTIME_ERROR(MESSAGE)
Macro used to throw a catapult runtime error.
Definition: exceptions.h:167
auto cbegin() const
Returns a const iterator that represents the first entity.
Definition: ContiguousEntityContainer.h:181
constexpr bool isEnd(value_type *pEntity) const noexcept
Definition: ContiguousEntityContainer.h:155
Do not throw when an iteration error is encountered (but error flag will still be set).
Definition: AddressExtractionExtension.cpp:28
State m_state
Definition: ContiguousEntityContainer.h:208
constexpr auto endBytePointer() const noexcept
Definition: ContiguousEntityContainer.h:159
Definition: ContiguousEntityContainer.h:52
constexpr State(size_t size, bool throwOnError)
Definition: ContiguousEntityContainer.h:59
std::forward_iterator_tag iterator_category
Definition: ContiguousEntityContainer.h:75
TIteratorEntity & reference
Definition: ContiguousEntityContainer.h:74
bool hasError() const
Gets a value indicating whether or not there was an iteration error.
Definition: ContiguousEntityContainer.h:202
pointer operator->() const
Returns a pointer to the current entity.
Definition: ContiguousEntityContainer.h:140
static constexpr auto ToBytePointer(const T *pEntity)
Definition: ContiguousEntityContainer.h:84