Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::impl::ReferenceCounterWrapper< InstanceType > Class Template Reference

Wrapper around a class managing its own reference counter. More...

#include <arccore/base/Ref.h>

Public Member Functions

 ReferenceCounterWrapper (InstanceType *ptr, const RefBase::BasicDeleterBase &)
 Constructor with an empty deleter. In this case, it does not need to be kept.
template<typename U>
 ReferenceCounterWrapper (InstanceType *ptr, const U &deleter_base)
 ReferenceCounterWrapper (InstanceType *ptr)
template<typename T, typename X = typename std::is_convertible<T*, InstanceType*>::type>
 ReferenceCounterWrapper (const ReferenceCounterWrapper< T > &r)
 Allows conversion if 'T*' and 'InstanceType*' are convertible.
InstanceType * get () const
 Returns the instance.
void reset ()
 Resets the currently associated reference.
RefBase::DeleterBasegetDeleter ()

Detailed Description

template<typename InstanceType>
class Arcane::impl::ReferenceCounterWrapper< InstanceType >

Wrapper around a class managing its own reference counter.

The class InstanceType must manage its own reference counter and its own destruction.

Definition at line 33 of file arccore/src/base/arccore/base/Ref.h.

Constructor & Destructor Documentation

◆ ReferenceCounterWrapper() [1/4]

template<typename InstanceType>
Arcane::impl::ReferenceCounterWrapper< InstanceType >::ReferenceCounterWrapper ( InstanceType * ptr,
const RefBase::BasicDeleterBase &  )
inline

Constructor with an empty deleter. In this case, it does not need to be kept.

Definition at line 45 of file arccore/src/base/arccore/base/Ref.h.

Referenced by ReferenceCounterWrapper().

◆ ReferenceCounterWrapper() [2/4]

template<typename InstanceType>
template<typename U>
Arcane::impl::ReferenceCounterWrapper< InstanceType >::ReferenceCounterWrapper ( InstanceType * ptr,
const U & deleter_base )
inline

Definition at line 51 of file arccore/src/base/arccore/base/Ref.h.

◆ ReferenceCounterWrapper() [3/4]

template<typename InstanceType>
Arcane::impl::ReferenceCounterWrapper< InstanceType >::ReferenceCounterWrapper ( InstanceType * ptr)
inlineexplicit

Definition at line 59 of file arccore/src/base/arccore/base/Ref.h.

◆ ReferenceCounterWrapper() [4/4]

template<typename InstanceType>
template<typename T, typename X = typename std::is_convertible<T*, InstanceType*>::type>
Arcane::impl::ReferenceCounterWrapper< InstanceType >::ReferenceCounterWrapper ( const ReferenceCounterWrapper< T > & r)
inlineexplicit

Allows conversion if 'T*' and 'InstanceType*' are convertible.

Definition at line 67 of file arccore/src/base/arccore/base/Ref.h.

References get(), and ReferenceCounterWrapper().

Member Function Documentation

◆ get()

template<typename InstanceType>
InstanceType * Arcane::impl::ReferenceCounterWrapper< InstanceType >::get ( ) const
inline

Returns the instance.

Definition at line 77 of file arccore/src/base/arccore/base/Ref.h.

Referenced by ReferenceCounterWrapper().

◆ getDeleter()

template<typename InstanceType>
RefBase::DeleterBase * Arcane::impl::ReferenceCounterWrapper< InstanceType >::getDeleter ( )
inline

Definition at line 82 of file arccore/src/base/arccore/base/Ref.h.

◆ reset()

template<typename InstanceType>
void Arcane::impl::ReferenceCounterWrapper< InstanceType >::reset ( )
inline

Resets the currently associated reference.

Definition at line 80 of file arccore/src/base/arccore/base/Ref.h.


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