ECSM v0.6.0
OptView< T > Struct Template Reference

Optional view of the item in the LinearPool. (Nullable). More...

#include <linear-pool.hpp>

Public Member Functions

constexpr OptView () noexcept=default
 Creates null optional view.
template<class U>
constexpr OptView (const View< U > &view) noexcept
 Creates a new optional view. (Nullable).
template<class U>
constexpr OptView (const OptView< U > &view) noexcept
 Changes the type of the item optional view. (Nullable).
constexpr operator bool () noexcept
 Returns true if item optional view is not null.
constexpr operator const View< T > & () const
 Converts optional view to the non-nullable view.
T * operator-> ()
 Optional view item data accessor.
const T * operator-> () const
 Optional view 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.
bool isNullChecked () const noexcept
 Returns true if view was checked for null. (Debug only!).
const View< T > & getView_ () const noexcept
 Returns optional view internal item view.

Detailed Description

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

Optional view of the item in the LinearPool. (Nullable).

Template Parameters
Ttype of the item in the linear pool

See the View<T>.

Constructor & Destructor Documentation

◆ OptView() [1/2]

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

Creates a new optional view. (Nullable).

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

◆ OptView() [2/2]

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

Changes the type of the item optional view. (Nullable).

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