Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::RefImpl< InstanceType, RefClassType, ImplTagId > Class Template Reference

Implementation of the reference to an instance. More...

#include </__w/arcaneframework.github.io/arcaneframework.github.io/framework/arccore/src/base/arccore/base/Ref.h>

Inheritance diagram for Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >:
Collaboration diagram for Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >:

Classes

class  Deleter
class  BasicDeleter

Public Types

using ThatClass = RefImpl<InstanceType, RefClassType, ImplTagId>
using ImplType = RefTraitsTagId<InstanceType, ImplTagId>::ImplType

Public Member Functions

template<typename T, typename = _IsRefConstructible<typename RefImpl<T, Ref<T>, ImplTagId>::ImplType>>
 RefImpl (const Ref< T > &rhs) noexcept
 Constructs a reference from another reference of a compatible type.
 RefImpl (const ThatClass &rhs)=default
ThatClass & operator= (const ThatClass &rhs)=default
 operator bool () const
InstanceType * get () const
 Associated instance or nullptr if none.
bool isNull () const
 Indicates if the counter references a non-null instance.
InstanceType * operator-> () const
void reset ()
 Positions the instance to the null pointer.
template<typename T = ThatClass, typename std::enable_if_t< T::RefType==REF_TAG_SHARED_PTR, bool > = true>
InstanceType * _release ()
 Releases the reference counter pointer without destroying it. This is only allowed if the implementation uses 'std::shared_ptr'.
const ImplType & _internalInstance () const

Static Public Attributes

static constexpr int RefType = RefTraitsTagId<InstanceType, ImplTagId>::RefType

Private Types

template<typename... _Args>
using _IsRefConstructible = typename std::enable_if<std::is_constructible<ImplType, _Args...>::value>::type

Private Member Functions

 RefImpl (InstanceType *t)
 RefImpl (InstanceType *t, Internal::ExternalRef handle)
 RefImpl (InstanceType *t, bool no_destroy)
 RefImpl (ImplType &&t)

Static Private Member Functions

static Deleter _createBasicDeleter (std::shared_ptr< InstanceType > *)
static BasicDeleterBase _createBasicDeleter (impl::ReferenceCounterWrapper< InstanceType > *)
static Deleter_getDeleter (std::shared_ptr< InstanceType > &v)
static DeleterBase_getDeleter (impl::ReferenceCounterWrapper< InstanceType > &v)

Private Attributes

ImplType m_instance

Friends

template<typename T>
class Ref
bool operator== (const ThatClass &a, const ThatClass &b)
bool operator!= (const ThatClass &a, const ThatClass &b)
bool operator< (const ThatClass &a, const ThatClass &b)
bool operator! (const ThatClass &a)

Detailed Description

template<typename InstanceType, typename RefClassType, int ImplTagId>
class Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >

Implementation of the reference to an instance.

See also
Ref

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

Member Typedef Documentation

◆ _IsRefConstructible

template<typename InstanceType, typename RefClassType, int ImplTagId>
template<typename... _Args>
using Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::_IsRefConstructible = typename std::enable_if<std::is_constructible<ImplType, _Args...>::value>::type
private

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

◆ ImplType

template<typename InstanceType, typename RefClassType, int ImplTagId>
using Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::ImplType = RefTraitsTagId<InstanceType, ImplTagId>::ImplType

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

◆ ThatClass

template<typename InstanceType, typename RefClassType, int ImplTagId>
using Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::ThatClass = RefImpl<InstanceType, RefClassType, ImplTagId>

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

Constructor & Destructor Documentation

◆ RefImpl() [1/5]

template<typename InstanceType, typename RefClassType, int ImplTagId>
Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::RefImpl ( InstanceType * t)
inlineexplicitprivate

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

◆ RefImpl() [2/5]

template<typename InstanceType, typename RefClassType, int ImplTagId>
Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::RefImpl ( InstanceType * t,
Internal::ExternalRef handle )
inlineprivate

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

◆ RefImpl() [3/5]

template<typename InstanceType, typename RefClassType, int ImplTagId>
Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::RefImpl ( InstanceType * t,
bool no_destroy )
inlineprivate

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

◆ RefImpl() [4/5]

template<typename InstanceType, typename RefClassType, int ImplTagId>
Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::RefImpl ( ImplType && t)
inlineprivate

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

◆ RefImpl() [5/5]

template<typename InstanceType, typename RefClassType, int ImplTagId>
template<typename T, typename = _IsRefConstructible<typename RefImpl<T, Ref<T>, ImplTagId>::ImplType>>
Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::RefImpl ( const Ref< T > & rhs)
inlineexplicitnoexcept

Constructs a reference from another reference of a compatible type.

Conversion is allowed if an instance of 'ImplType' can be constructed from an instance of Ref<T>::ImplType.

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

Member Function Documentation

◆ _createBasicDeleter() [1/2]

template<typename InstanceType, typename RefClassType, int ImplTagId>
BasicDeleterBase Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::_createBasicDeleter ( impl::ReferenceCounterWrapper< InstanceType > * )
inlinestaticprivate

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

◆ _createBasicDeleter() [2/2]

template<typename InstanceType, typename RefClassType, int ImplTagId>
Deleter Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::_createBasicDeleter ( std::shared_ptr< InstanceType > * )
inlinestaticprivate

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

◆ _getDeleter() [1/2]

template<typename InstanceType, typename RefClassType, int ImplTagId>
DeleterBase * Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::_getDeleter ( impl::ReferenceCounterWrapper< InstanceType > & v)
inlinestaticprivate

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

◆ _getDeleter() [2/2]

template<typename InstanceType, typename RefClassType, int ImplTagId>
Deleter * Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::_getDeleter ( std::shared_ptr< InstanceType > & v)
inlinestaticprivate

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

◆ _internalInstance()

template<typename InstanceType, typename RefClassType, int ImplTagId>
const ImplType & Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::_internalInstance ( ) const
inline

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

◆ _release()

template<typename InstanceType, typename RefClassType, int ImplTagId>
template<typename T = ThatClass, typename std::enable_if_t< T::RefType==REF_TAG_SHARED_PTR, bool > = true>
InstanceType * Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::_release ( )
inline

Releases the reference counter pointer without destroying it. This is only allowed if the implementation uses 'std::shared_ptr'.

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

◆ get()

template<typename InstanceType, typename RefClassType, int ImplTagId>
InstanceType * Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::get ( ) const
inline

◆ isNull()

template<typename InstanceType, typename RefClassType, int ImplTagId>
bool Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::isNull ( ) const
inline

Indicates if the counter references a non-null instance.

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

Referenced by Arcane::SimpleCsvReaderWriter::setInternal(), Arcane::SimpleTableInternalMng::setInternal(), Arcane::SimpleTableInternalComparator::setInternalRef(), Arcane::SimpleTableInternalComparator::setInternalToCompare(), and Arcane::SimpleTableWriterHelper::setReaderWriter().

Here is the caller graph for this function:

◆ operator bool()

template<typename InstanceType, typename RefClassType, int ImplTagId>
Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::operator bool ( ) const
inline

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

◆ operator->()

template<typename InstanceType, typename RefClassType, int ImplTagId>
InstanceType * Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::operator-> ( ) const
inline

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

◆ reset()

template<typename InstanceType, typename RefClassType, int ImplTagId>
void Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::reset ( )
inline

Positions the instance to the null pointer.

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

Referenced by Arcane::VariableIOReaderMng::_checkHashFunction().

Here is the caller graph for this function:

◆ operator!

template<typename InstanceType, typename RefClassType, int ImplTagId>
bool operator! ( const ThatClass & a)
friend

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

◆ operator!=

template<typename InstanceType, typename RefClassType, int ImplTagId>
bool operator!= ( const ThatClass & a,
const ThatClass & b )
friend

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

◆ operator<

template<typename InstanceType, typename RefClassType, int ImplTagId>
bool operator< ( const ThatClass & a,
const ThatClass & b )
friend

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

◆ operator==

template<typename InstanceType, typename RefClassType, int ImplTagId>
bool operator== ( const ThatClass & a,
const ThatClass & b )
friend

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

◆ Ref

template<typename InstanceType, typename RefClassType, int ImplTagId>
template<typename T>
friend class Ref
friend

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

Member Data Documentation

◆ m_instance

template<typename InstanceType, typename RefClassType, int ImplTagId>
ImplType Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::m_instance
private

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

◆ RefType

template<typename InstanceType, typename RefClassType, int ImplTagId>
int Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::RefType = RefTraitsTagId<InstanceType, ImplTagId>::RefType
staticconstexpr

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


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