DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::ObjectPool< T >::ObjectPoolAllocated Class Reference

RAII handle returned by ObjectPoolget (and friends). More...

#include <ObjectPool.hpp>

Public Member Functions

 ObjectPoolAllocated (uPtrResource n_ptr, std::shared_ptr< Pool > &pPool)
 
 ObjectPoolAllocated (ObjectPoolAllocated &&R) noexcept
 
void operator= (ObjectPoolAllocated &&R) noexcept
 
T & operator* ()
 
const T & operator* () const
 
 operator bool () const
 true if the handle holds an object.
 
uPtrResourceoperator-> ()
 Arrow-access to the underlying unique_ptr (lets callers reach through it to T).
 
 ~ObjectPoolAllocated ()
 

Detailed Description

template<class T = int>
class DNDS::ObjectPool< T >::ObjectPoolAllocated

RAII handle returned by ObjectPoolget (and friends).

Behaves like a unique_ptr<T>; in its destructor it returns the managed object to the pool (or drops it if the pool is already gone).

Definition at line 69 of file ObjectPool.hpp.

Constructor & Destructor Documentation

◆ ObjectPoolAllocated() [1/2]

template<class T = int>
DNDS::ObjectPool< T >::ObjectPoolAllocated::ObjectPoolAllocated ( uPtrResource  n_ptr,
std::shared_ptr< Pool > &  pPool 
)
inline

Definition at line 75 of file ObjectPool.hpp.

◆ ObjectPoolAllocated() [2/2]

template<class T = int>
DNDS::ObjectPool< T >::ObjectPoolAllocated::ObjectPoolAllocated ( ObjectPoolAllocated &&  R)
inlinenoexcept

Definition at line 81 of file ObjectPool.hpp.

◆ ~ObjectPoolAllocated()

template<class T = int>
DNDS::ObjectPool< T >::ObjectPoolAllocated::~ObjectPoolAllocated ( )
inline

Definition at line 98 of file ObjectPool.hpp.

Member Function Documentation

◆ operator bool()

template<class T = int>
DNDS::ObjectPool< T >::ObjectPoolAllocated::operator bool ( ) const
inline

true if the handle holds an object.

Definition at line 94 of file ObjectPool.hpp.

◆ operator*() [1/2]

template<class T = int>
T & DNDS::ObjectPool< T >::ObjectPoolAllocated::operator* ( )
inline

Definition at line 91 of file ObjectPool.hpp.

◆ operator*() [2/2]

template<class T = int>
const T & DNDS::ObjectPool< T >::ObjectPoolAllocated::operator* ( ) const
inline

Definition at line 92 of file ObjectPool.hpp.

◆ operator->()

template<class T = int>
uPtrResource & DNDS::ObjectPool< T >::ObjectPoolAllocated::operator-> ( )
inline

Arrow-access to the underlying unique_ptr (lets callers reach through it to T).

Definition at line 97 of file ObjectPool.hpp.

◆ operator=()

template<class T = int>
void DNDS::ObjectPool< T >::ObjectPoolAllocated::operator= ( ObjectPoolAllocated &&  R)
inlinenoexcept

Definition at line 86 of file ObjectPool.hpp.


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