cycle_ptr
Classes | Public Member Functions | Static Public Member Functions | List of all members
cycle_ptr::detail::base_control::publisher Class Reference

Address range publisher. More...

#include <base_control.h>

Public Member Functions

 publisher (void *addr, std::size_t len, base_control &bc)
 Publish a base_control for an object at the given address.
 
 ~publisher () noexcept
 Destructor, unpublishes the range.
 

Static Public Member Functions

static auto lookup (void *addr, std::size_t len) -> intrusive_ptr< base_control >
 Perform a lookup, to figure out which control manages the given address range. More...
 

Detailed Description

Address range publisher.

Publishes that a range of memory is managed by a specific control block, so that base_control and cycle_member_ptr can use automatic deduction of ownership.

Member Function Documentation

◆ lookup()

static auto cycle_ptr::detail::base_control::publisher::lookup ( void *  addr,
std::size_t  len 
) -> intrusive_ptr< base_control >
static

Perform a lookup, to figure out which control manages the given address range.

Finds the base_control for which a publisher is active. The range is usually smaller than the range managed by the control.

Parameters
[in]addrObject offset for which to find a base_control.
[in]lenSizeof the object for which to find a base control.
Returns
Base control owning the argument address range.
Exceptions
std::runtime_errorif no pushlished range covers the argument range.

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