CatapultServer  v0.5.0.1 (Elephant)
catapult::model::EntityRange< TEntity > Class Template Reference

Represents a range of entities. More...

Inheritance diagram for catapult::model::EntityRange< TEntity >:
Collaboration diagram for catapult::model::EntityRange< TEntity >:

Classes

class  iterator
 Entity range iterator. More...
 
class  MultiBufferRange
 
class  SingleBufferRange
 
class  SingleEntityRange
 
class  SubRange
 

Public Types

using value_type = TEntity
 

Public Member Functions

 EntityRange ()
 Creates an empty entity range. More...
 
bool empty () const
 Gets a value indicating whether or not this range is empty. More...
 
size_t size () const
 Gets the size of this range. More...
 
size_t totalSize () const
 Gets the total size of the range in bytes. More...
 
auto cbegin () const
 Returns a const iterator that represents the first entity. More...
 
auto cend () const
 Returns a const iterator that represents one past the last entity. More...
 
auto begin () const
 Returns a const iterator that represents the first entity. More...
 
auto end () const
 Returns a const iterator that represents one past the last entity. More...
 
auto begin ()
 Returns an iterator that represents the first entity. More...
 
auto end ()
 Returns an iterator that represents one past the last entity. More...
 
const auto * data () const
 
auto * data ()
 
- Public Member Functions inherited from catapult::utils::MoveOnly
constexpr MoveOnly ()=default
 Default constructor. More...
 
 ~MoveOnly ()=default
 Default destructor. More...
 
 MoveOnly (const NonCopyable &)=delete
 Disabled copy constructor. More...
 
 MoveOnly (MoveOnly &&)=default
 Default move constructor. More...
 
MoveOnlyoperator= (const MoveOnly &)=delete
 Disabled assignment operator. More...
 
MoveOnlyoperator= (MoveOnly &&)=default
 Default move assignment operator. More...
 

Static Public Member Functions

static EntityRange PrepareFixed (size_t numElements, uint8_t **ppRangeData=nullptr)
 
static EntityRange CopyFixed (const uint8_t *pData, size_t numElements)
 Creates an entity range around numElements fixed size elements pointed to by pData. More...
 
static EntityRange CopyVariable (const uint8_t *pData, size_t dataSize, const std::vector< size_t > &offsets)
 
static EntityRange FromEntity (std::unique_ptr< TEntity > &&pEntity)
 Creates an entity range around a single entity (pEntity). More...
 
static EntityRange MergeRanges (std::vector< EntityRange > &&ranges)
 Merges all ranges into a single range. More...
 
static EntityRange CopyRange (const EntityRange &rhs)
 Creates an entity range by making a copy of an existing range rhs. More...
 
static std::vector< std::shared_ptr< TEntity > > ExtractEntitiesFromRange (EntityRange &&range)
 

Private Member Functions

 EntityRange (SingleBufferRange &&subRange)
 
 EntityRange (SingleEntityRange &&subRange)
 
 EntityRange (MultiBufferRange &&subRange)
 
void requireContiguousData () const
 
const SubRangesubRange () const
 
SubRangesubRange ()
 
auto copySubRange () const
 
auto detachSubRangeEntities ()
 
template<typename TFunc >
auto activeSubRangeAction (TFunc func) const
 
template<typename TFunc >
auto activeSubRangeAction (TFunc func)
 

Static Private Member Functions

template<typename TIterator >
static auto make_const_iterator (TIterator current)
 
template<typename TIterator >
static auto make_iterator (TIterator current)
 

Private Attributes

SingleBufferRange m_singleBufferRange
 
SingleEntityRange m_singleEntityRange
 
MultiBufferRange m_multiBufferRange
 

Friends

class MultiBufferRange
 

Detailed Description

template<typename TEntity>
class catapult::model::EntityRange< TEntity >

Represents a range of entities.

Member Typedef Documentation

◆ value_type

template<typename TEntity>
using catapult::model::EntityRange< TEntity >::value_type = TEntity

Constructor & Destructor Documentation

◆ EntityRange() [1/4]

template<typename TEntity>
catapult::model::EntityRange< TEntity >::EntityRange ( )
inline

Creates an empty entity range.

Here is the caller graph for this function:

◆ EntityRange() [2/4]

template<typename TEntity>
catapult::model::EntityRange< TEntity >::EntityRange ( SingleBufferRange &&  subRange)
inlineexplicitprivate

◆ EntityRange() [3/4]

template<typename TEntity>
catapult::model::EntityRange< TEntity >::EntityRange ( SingleEntityRange< TEntity > &&  subRange)
inlineexplicitprivate

◆ EntityRange() [4/4]

template<typename TEntity>
catapult::model::EntityRange< TEntity >::EntityRange ( MultiBufferRange &&  subRange)
inlineexplicitprivate

Member Function Documentation

◆ activeSubRangeAction() [1/2]

template<typename TEntity>
template<typename TFunc >
auto catapult::model::EntityRange< TEntity >::activeSubRangeAction ( TFunc  func)
inlineprivate

◆ activeSubRangeAction() [2/2]

template<typename TEntity>
template<typename TFunc >
auto catapult::model::EntityRange< TEntity >::activeSubRangeAction ( TFunc  func) const
inlineprivate
Here is the caller graph for this function:

◆ begin() [1/2]

template<typename TEntity>
auto catapult::model::EntityRange< TEntity >::begin ( )
inline

Returns an iterator that represents the first entity.

◆ begin() [2/2]

template<typename TEntity>
auto catapult::model::EntityRange< TEntity >::begin ( ) const
inline

Returns a const iterator that represents the first entity.

Here is the caller graph for this function:

◆ cbegin()

template<typename TEntity>
auto catapult::model::EntityRange< TEntity >::cbegin ( ) const
inline

Returns a const iterator that represents the first entity.

Here is the caller graph for this function:

◆ cend()

template<typename TEntity>
auto catapult::model::EntityRange< TEntity >::cend ( ) const
inline

Returns a const iterator that represents one past the last entity.

Here is the caller graph for this function:

◆ CopyFixed()

template<typename TEntity>
static EntityRange catapult::model::EntityRange< TEntity >::CopyFixed ( const uint8_t *  pData,
size_t  numElements 
)
inlinestatic

Creates an entity range around numElements fixed size elements pointed to by pData.

Here is the caller graph for this function:

◆ CopyRange()

template<typename TEntity>
static EntityRange catapult::model::EntityRange< TEntity >::CopyRange ( const EntityRange< TEntity > &  rhs)
inlinestatic

Creates an entity range by making a copy of an existing range rhs.

◆ copySubRange()

template<typename TEntity>
auto catapult::model::EntityRange< TEntity >::copySubRange ( ) const
inlineprivate
Here is the caller graph for this function:

◆ CopyVariable()

template<typename TEntity>
static EntityRange catapult::model::EntityRange< TEntity >::CopyVariable ( const uint8_t *  pData,
size_t  dataSize,
const std::vector< size_t > &  offsets 
)
inlinestatic

Creates an entity range around the data pointed to by pData with size dataSize and an offsets container that contains values indicating the starting position of all entities in the data.

Here is the caller graph for this function:

◆ data() [1/2]

template<typename TEntity>
auto* catapult::model::EntityRange< TEntity >::data ( )
inline

Gets a pointer to the start of the data range.

Note
This will throw if not supported.

◆ data() [2/2]

template<typename TEntity>
const auto* catapult::model::EntityRange< TEntity >::data ( ) const
inline

Gets a const pointer to the start of the data range.

Note
This will throw if not supported.

◆ detachSubRangeEntities()

template<typename TEntity>
auto catapult::model::EntityRange< TEntity >::detachSubRangeEntities ( )
inlineprivate

◆ empty()

template<typename TEntity>
bool catapult::model::EntityRange< TEntity >::empty ( ) const
inline

Gets a value indicating whether or not this range is empty.

Here is the caller graph for this function:

◆ end() [1/2]

template<typename TEntity>
auto catapult::model::EntityRange< TEntity >::end ( )
inline

Returns an iterator that represents one past the last entity.

◆ end() [2/2]

template<typename TEntity>
auto catapult::model::EntityRange< TEntity >::end ( ) const
inline

Returns a const iterator that represents one past the last entity.

Here is the caller graph for this function:

◆ ExtractEntitiesFromRange()

template<typename TEntity>
static std::vector<std::shared_ptr<TEntity> > catapult::model::EntityRange< TEntity >::ExtractEntitiesFromRange ( EntityRange< TEntity > &&  range)
inlinestatic

Extracts a vector of entities from a range such that each entity will extend the lifetime of the owning range.

◆ FromEntity()

template<typename TEntity>
static EntityRange catapult::model::EntityRange< TEntity >::FromEntity ( std::unique_ptr< TEntity > &&  pEntity)
inlinestatic

Creates an entity range around a single entity (pEntity).

Here is the caller graph for this function:

◆ make_const_iterator()

template<typename TEntity>
template<typename TIterator >
static auto catapult::model::EntityRange< TEntity >::make_const_iterator ( TIterator  current)
inlinestaticprivate
Here is the caller graph for this function:

◆ make_iterator()

template<typename TEntity>
template<typename TIterator >
static auto catapult::model::EntityRange< TEntity >::make_iterator ( TIterator  current)
inlinestaticprivate
Here is the caller graph for this function:

◆ MergeRanges()

template<typename TEntity>
static EntityRange catapult::model::EntityRange< TEntity >::MergeRanges ( std::vector< EntityRange< TEntity > > &&  ranges)
inlinestatic

Merges all ranges into a single range.

Here is the caller graph for this function:

◆ PrepareFixed()

template<typename TEntity>
static EntityRange catapult::model::EntityRange< TEntity >::PrepareFixed ( size_t  numElements,
uint8_t **  ppRangeData = nullptr 
)
inlinestatic

Creates an uninitialized entity range of contiguous memory around numElements fixed size elements. ppRangeData is set to point to the range memory.

Here is the caller graph for this function:

◆ requireContiguousData()

template<typename TEntity>
void catapult::model::EntityRange< TEntity >::requireContiguousData ( ) const
inlineprivate
Here is the caller graph for this function:

◆ size()

template<typename TEntity>
size_t catapult::model::EntityRange< TEntity >::size ( ) const
inline

Gets the size of this range.

Here is the caller graph for this function:

◆ subRange() [1/2]

template<typename TEntity>
SubRange& catapult::model::EntityRange< TEntity >::subRange ( )
inlineprivate

◆ subRange() [2/2]

template<typename TEntity>
const SubRange& catapult::model::EntityRange< TEntity >::subRange ( ) const
inlineprivate
Here is the caller graph for this function:

◆ totalSize()

template<typename TEntity>
size_t catapult::model::EntityRange< TEntity >::totalSize ( ) const
inline

Gets the total size of the range in bytes.

Friends And Related Function Documentation

◆ MultiBufferRange

template<typename TEntity>
friend class MultiBufferRange
friend

Member Data Documentation

◆ m_multiBufferRange

template<typename TEntity>
MultiBufferRange catapult::model::EntityRange< TEntity >::m_multiBufferRange
private

◆ m_singleBufferRange

template<typename TEntity>
SingleBufferRange catapult::model::EntityRange< TEntity >::m_singleBufferRange
private

◆ m_singleEntityRange

template<typename TEntity>
SingleEntityRange catapult::model::EntityRange< TEntity >::m_singleEntityRange
private

The documentation for this class was generated from the following file: