ChimeraTK-cppext 01.07.01
Loading...
Searching...
No Matches
cppext::detail::shared_state_ptr Struct Reference

shared_ptr-like smart pointer type for referencing the shared_state. More...

#include <future_queue.hpp>

Public Member Functions

 shared_state_ptr ()
 Default constructor: create empty pointer.
 
 shared_state_ptr (const shared_state_ptr &other)
 Copy constructor.
 
shared_state_ptroperator= (const shared_state_ptr &other)
 Copy by assignment.
 
 ~shared_state_ptr ()
 Destructor.
 
template<typename T >
void make_new (size_t length)
 Create new shared_state for type T.
 
shared_state_baseoperator-> ()
 Dereferencing operator.
 
const shared_state_baseoperator-> () const
 
template<typename T >
shared_state< T > * cast ()
 Cast into shared state for type T.
 
 operator bool () const
 Check if pointer is initialised.
 
bool operator== (const shared_state_ptr &other) const
 Check if two pointers are identical.
 
shared_state_baseget () const
 Obtain the target pointer.
 
void set (shared_state_base *ptr_)
 Set the target pointer without incrementing the reference counter.
 

Detailed Description

shared_ptr-like smart pointer type for referencing the shared_state.

This is required (instead or in addition to using a shared_ptr), since in case of a async continuation the internal thread always holds a reference to the shared_state but should be destroyed when the last reference (outside the internal thread) gets destroyed.

Definition at line 47 of file future_queue.hpp.

Constructor & Destructor Documentation

◆ shared_state_ptr() [1/2]

cppext::detail::shared_state_ptr::shared_state_ptr ( )
inline

Default constructor: create empty pointer.

Definition at line 673 of file future_queue.hpp.

◆ shared_state_ptr() [2/2]

cppext::detail::shared_state_ptr::shared_state_ptr ( const shared_state_ptr other)
inline

Copy constructor.

Definition at line 675 of file future_queue.hpp.

◆ ~shared_state_ptr()

cppext::detail::shared_state_ptr::~shared_state_ptr ( )
inline

Destructor.

Definition at line 689 of file future_queue.hpp.

Member Function Documentation

◆ cast()

template<typename T >
shared_state< T > * cppext::detail::shared_state_ptr::cast ( )

Cast into shared state for type T.

Definition at line 730 of file future_queue.hpp.

◆ get()

shared_state_base * cppext::detail::shared_state_ptr::get ( ) const
inline

Obtain the target pointer.

Definition at line 693 of file future_queue.hpp.

◆ make_new()

template<typename T >
void cppext::detail::shared_state_ptr::make_new ( size_t  length)

Create new shared_state for type T.

Definition at line 713 of file future_queue.hpp.

◆ operator bool()

cppext::detail::shared_state_ptr::operator bool ( ) const
inline

Check if pointer is initialised.

Definition at line 735 of file future_queue.hpp.

◆ operator->() [1/2]

shared_state_base * cppext::detail::shared_state_ptr::operator-> ( )
inline

Dereferencing operator.

Definition at line 719 of file future_queue.hpp.

◆ operator->() [2/2]

const shared_state_base * cppext::detail::shared_state_ptr::operator-> ( ) const
inline

Definition at line 724 of file future_queue.hpp.

◆ operator=()

shared_state_ptr & cppext::detail::shared_state_ptr::operator= ( const shared_state_ptr other)
inline

Copy by assignment.

Definition at line 681 of file future_queue.hpp.

◆ operator==()

bool cppext::detail::shared_state_ptr::operator== ( const shared_state_ptr other) const
inline

Check if two pointers are identical.

Definition at line 739 of file future_queue.hpp.

◆ set()

void cppext::detail::shared_state_ptr::set ( shared_state_base ptr_)
inline

Set the target pointer without incrementing the reference counter.

Definition at line 697 of file future_queue.hpp.


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