ECSM v0.2.0
View< T >final

View of the item in the LinearPool. More...

#include <linear-pool.hpp>

Public Member Functions

constexpr View ()=default
 Creates a new null item view.
 
template<class U >
constexpr View (const View< U > &view) noexcept
 Changes the type of the item view.
 
T * operator-> ()
 Item data accessor.
 
const T * operator-> () const
 Item constant data accessor.
 
T * operator* ()
 Returns pointer to the item memory in the pool.
 
const T * operator* () const
 Returns pointer to the constant item memory in the pool.
 
constexpr operator bool () const noexcept
 Returns true if item view is not null.
 
const uint64_t * getPoolVersion () const noexcept
 
uint64_t getVersion () const noexcept
 

Friends

class LinearPool< T, true >
 
class LinearPool< T, false >
 

Detailed Description

template<class T>
struct ecsm::View< T >

View of the item in the LinearPool.

Template Parameters
Ttype of the item in the linear pool

The view provides a way to access the contents of an item within the pool, allowing to inspect or modify its data.

Constructor & Destructor Documentation

◆ View()

template<class T >
template<class U >
constexpr View ( const View< U > & view)
inlineexplicitconstexprnoexcept

Changes the type of the item view.

Useful in cases where we need to cast item view type.

Template Parameters
Uis a new type of the item view
Parameters
[in]viewtarget item view