BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl::SharedPtr_ImpUtil Struct Reference

#include <bslstl_sharedptr.h>

Classes

struct  Extent
 

Static Public Member Functions

template<class SHARED_TYPE , class ENABLE_TYPE >
static void loadEnableSharedFromThis (const bsl::enable_shared_from_this< ENABLE_TYPE > *result, bsl::shared_ptr< SHARED_TYPE > *sharedPtr)
 
static void loadEnableSharedFromThis (const volatile void *, const void *) BSLS_KEYWORD_NOEXCEPT
 
static void throwBadWeakPtr ()
 Throw a bsl::bad_weak_ptr exception.
 
template<class TYPE >
static void * voidify (TYPE *address) BSLS_KEYWORD_NOEXCEPT
 
template<class TYPE >
static TYPE * unqualify (const volatile TYPE *address) BSLS_KEYWORD_NOEXCEPT
 

Detailed Description

This struct should be used by only shared_ptr constructors. Its purpose is to enable shared_ptr constructors to determine if the (template parameter) types COMPATIBLE_TYPE or ELEMENT_TYPE have a specialization of enable_shared_from_this as an unambiguous, publicly accessible, base class.

Member Function Documentation

◆ loadEnableSharedFromThis() [1/2]

template<class SHARED_TYPE , class ENABLE_TYPE >
void bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis ( const bsl::enable_shared_from_this< ENABLE_TYPE > *  result,
bsl::shared_ptr< SHARED_TYPE > *  sharedPtr 
)
inlinestatic

Load the specified result with the control block (i.e., SharedPtrRep) from the specified sharedPtr if (and only if) result is not 0 and result does not already refer to a non-expired shared-pointer control block. If result is 0, or if result->d_weakThis has not expired, this operation has no effect. This operation is used to initialize data members from a type that inherits from enable_shared_from_this when constructing an out-of-place shared pointer representation. This function shall be called only by shared_ptr constructors creating shared pointers for classes that derive publicly and unambiguously from a specialization of enabled_shared_from_this. Note that overload resolution will select the overload below if a supplied type does not derive from a specialization of enable_shared_from_this.

◆ loadEnableSharedFromThis() [2/2]

void bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis ( const volatile void *  ,
const void *   
)
inlinestatic

Do nothing. This overload is selected, rather than the immediately preceding template, when the SHARED_TYPE template type parameter of shared_ptr<SHARED_TYPE> does not derive from a specialization of enable_shared_from_this.

◆ throwBadWeakPtr()

static void bslstl::SharedPtr_ImpUtil::throwBadWeakPtr ( )
static

◆ unqualify()

template<class TYPE >
TYPE * bslstl::SharedPtr_ImpUtil::unqualify ( const volatile TYPE *  address)
inlinestatic

Return the specified address of a potentially cv-qualified object of the given (template parameter) TYPE, cast as a pointer to a modifiable non-volatile object of the given TYPE.

◆ voidify()

template<class TYPE >
void * bslstl::SharedPtr_ImpUtil::voidify ( TYPE *  address)
inlinestatic

Return the specified address cast as a pointer to void, even if (the template parameter) TYPE is cv-qualified.


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