cycle_ptr
Public Member Functions | List of all members
cycle_ptr::detail::control< T, Alloc > Class Template Referencefinal

Control block implementation for given type and allocator combination. More...

#include <control.h>

Inheritance diagram for cycle_ptr::detail::control< T, Alloc >:
Inheritance graph
[legend]
Collaboration diagram for cycle_ptr::detail::control< T, Alloc >:
Collaboration graph
[legend]

Public Member Functions

 control (Alloc alloc)
 Create control block. More...
 
template<typename... Args>
auto instantiate (Args &&... args) -> T *
 Instantiate the object managed by this control block. More...
 
- Public Member Functions inherited from cycle_ptr::detail::base_control
auto expired () const noexcept -> bool
 Test if the object managed by this control is expired.
 
auto weak_acquire () noexcept -> bool
 Used by weak to strong reference promotion. More...
 
auto acquire_no_red () noexcept -> void
 Acquire reference. More...
 
auto acquire () noexcept -> void
 Acquire reference. More...
 
auto release (bool skip_gc=false) noexcept -> void
 Release reference counter. More...
 
auto gc () noexcept -> void
 Run GC.
 
auto push_back (vertex &v) noexcept -> void
 Register a vertex.
 
auto erase (vertex &v) noexcept -> void
 Deregister a vertex.
 
virtual auto is_unowned () const noexcept -> bool
 Test if this control block represents an unowned object.
 

Additional Inherited Members

- Static Public Member Functions inherited from cycle_ptr::detail::base_control
static auto unowned_control () -> intrusive_ptr< base_control >
 Create a control block that represents no ownership.
 
static auto publisher_lookup (void *addr, std::size_t len) -> intrusive_ptr< base_control >
 Implements publisher lookup based on address range.
 
- Public Attributes inherited from cycle_ptr::detail::base_control
bool under_construction = true
 This variable indicates the managed object is under construction. More...
 
- Protected Member Functions inherited from cycle_ptr::detail::base_control
 base_control ()
 Default constructor allocates a new generation.
 
 base_control (intrusive_ptr< generation > g) noexcept
 Constructor to use a specific generation.
 
 ~base_control () noexcept
 Destructor.
 

Detailed Description

template<typename T, typename Alloc>
class cycle_ptr::detail::control< T, Alloc >

Control block implementation for given type and allocator combination.

Extends base_control, adding specifics for creating and destroying T.

Template Parameters
TThe type of object managed by this control block.
AllocThe allocator used to allocate storage for this control block.

Constructor & Destructor Documentation

◆ control()

template<typename T , typename Alloc >
cycle_ptr::detail::control< T, Alloc >::control ( Alloc  alloc)
inline

Create control block.

Parameters
allocThe allocator used to allocate space for this control block.

Member Function Documentation

◆ instantiate()

template<typename T , typename Alloc >
template<typename... Args>
auto cycle_ptr::detail::control< T, Alloc >::instantiate ( Args &&...  args) -> T*
inline

Instantiate the object managed by this control block.

Uses placement new to instantiate the object that is being managed.

Precondition
!this->under_construction
Postcondition
this->under_construction
Parameters
argsArguments to pass to constructor of T.
Exceptions
...if constructor of T throws.

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