neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib::ref_ptr< Interface > Class Template Reference

#include <reference_counted.hpp>

Inheritance diagram for neolib::ref_ptr< Interface >:
neolib::i_ref_ptr< abstract_t< Interface > >

Public Types

typedef Interface element_type
 
typedef i_ref_ptr< abstract_t< Interface > > abstract_type
 
typedef abstract_type::no_object no_object
 
typedef abstract_type::no_managed_object no_managed_object
 
typedef abstract_type::interface_not_found interface_not_found
 
- Public Types inherited from neolib::i_ref_ptr< abstract_t< Interface > >
typedef self_type abstract_type
 

Public Member Functions

 ref_ptr (Interface *aManagedPtr=nullptr) noexcept
 
 ref_ptr (Interface &aManagedPtr) noexcept
 
 ref_ptr (ref_ptr const &aOther) noexcept
 
 ref_ptr (ref_ptr &&aOther) noexcept
 
 ref_ptr (ref_ptr const &aOther, Interface *aPtr) noexcept
 
 ref_ptr (ref_ptr &&aOther, Interface *aPtr) noexcept
 
 ref_ptr (abstract_type const &aOther, Interface *aPtr) noexcept
 
 ref_ptr (abstract_type const &aOther) noexcept
 
 ref_ptr (i_discoverable &aDiscoverable)
 
template<typename Interface2 , typename = std::enable_if_t<std::is_base_of_v<Interface, Interface2>, sfinae>>
 ref_ptr (ref_ptr< Interface2 > const &aOther) noexcept
 
template<typename Interface2 , typename = std::enable_if_t<std::is_base_of_v<Interface, Interface2>, sfinae>>
 ref_ptr (ref_ptr< Interface2 > &&aOther) noexcept
 
template<typename Interface2 , typename = std::enable_if_t<std::is_base_of_v<Interface, Interface2>, sfinae>>
 ref_ptr (i_ref_ptr< Interface2 > const &aOther) noexcept
 
template<typename Interface2 >
 ref_ptr (ref_ptr< Interface2 > const &aOther, Interface *aPtr) noexcept
 
template<typename Interface2 >
 ref_ptr (ref_ptr< Interface2 > &&aOther, Interface *aPtr) noexcept
 
template<typename Interface2 >
 ref_ptr (i_ref_ptr< Interface2 > const &aOther, Interface *aPtr) noexcept
 
 ~ref_ptr ()
 
ref_ptroperator= (ref_ptr const &aOther)
 
ref_ptroperator= (ref_ptr &&aOther)
 
ref_ptroperator= (abstract_type const &aOther)
 
template<typename Interface2 , typename = std::enable_if_t<std::is_base_of_v<Interface, Interface2>, sfinae>>
ref_ptroperator= (ref_ptr< Interface2 > const &aOther)
 
template<typename Interface2 , typename = std::enable_if_t<std::is_base_of_v<Interface, Interface2>, sfinae>>
ref_ptroperator= (ref_ptr< Interface2 > &&aOther)
 
template<typename Interface2 , typename = std::enable_if_t<std::is_base_of_v<Interface, Interface2>, sfinae>>
ref_ptroperator= (i_ref_ptr< Interface2 > const &aOther)
 
ref_ptroperator= (std::nullptr_t)
 
template<typename Interface2 >
ref_ptr< Interface2as ()
 
bool reference_counted () const noexcept override
 
int32_t use_count () const noexcept override
 
void reset () override
 
void reset (abstract_t< Interface > *aPtr) override
 
void reset (abstract_t< Interface > *aPtr, abstract_t< Interface > *aManagedPtr) override
 
void reset (abstract_t< Interface > *aPtr, abstract_t< Interface > *aManagedPtr, bool aReferenceCounted, bool aAddRef) override
 
Interface * release () override
 
Interface * detach () noexcept override
 
bool valid () const noexcept override
 
bool managing () const noexcept override
 
Interface * ptr () const noexcept override
 
Interface * managed_ptr () const noexcept override
 
Interface * operator-> () const override
 
Interface & operator* () const override
 
template<typename Interface2 = Interface, typename = std::enable_if_t<std::is_base_of_v<Interface2, Interface>, sfinae>>
void reset (Interface2 *aPtr, Interface2 *aManagedPtr, bool aReferenceCounted, bool aAddRef)
 
- Public Member Functions inherited from neolib::i_ref_ptr< abstract_t< Interface > >
virtual ~i_ref_ptr ()=default
 
i_ref_ptroperator= (const i_ref_ptr &aOther)
 
i_ref_ptroperator= (const i_ref_ptr< Interface2 > &aOther)
 
 operator bool () const noexcept
 
bool operator== (std::nullptr_t) const noexcept
 
bool operator== (const i_ref_ptr< Interface2 > &aOther) const noexcept
 
bool operator!= (std::nullptr_t) const noexcept
 
bool operator!= (const i_ref_ptr< Interface2 > &aOther) const noexcept
 
bool operator< (const i_ref_ptr< Interface2 > &aOther) const noexcept
 

Detailed Description

template<typename Interface>
class neolib::ref_ptr< Interface >

Definition at line 184 of file reference_counted.hpp.

Member Typedef Documentation

◆ abstract_type

template<typename Interface >
typedef i_ref_ptr<abstract_t<Interface> > neolib::ref_ptr< Interface >::abstract_type

Definition at line 188 of file reference_counted.hpp.

◆ element_type

template<typename Interface >
typedef Interface neolib::ref_ptr< Interface >::element_type

Definition at line 187 of file reference_counted.hpp.

◆ interface_not_found

template<typename Interface >
typedef abstract_type::interface_not_found neolib::ref_ptr< Interface >::interface_not_found

Definition at line 191 of file reference_counted.hpp.

◆ no_managed_object

template<typename Interface >
typedef abstract_type::no_managed_object neolib::ref_ptr< Interface >::no_managed_object

Definition at line 190 of file reference_counted.hpp.

◆ no_object

template<typename Interface >
typedef abstract_type::no_object neolib::ref_ptr< Interface >::no_object

Definition at line 189 of file reference_counted.hpp.

Constructor & Destructor Documentation

◆ ref_ptr() [1/15]

template<typename Interface >
neolib::ref_ptr< Interface >::ref_ptr ( Interface *  aManagedPtr = nullptr)
inlinenoexcept

Definition at line 193 of file reference_counted.hpp.

◆ ref_ptr() [2/15]

template<typename Interface >
neolib::ref_ptr< Interface >::ref_ptr ( Interface &  aManagedPtr)
inlinenoexcept

Definition at line 199 of file reference_counted.hpp.

◆ ref_ptr() [3/15]

template<typename Interface >
neolib::ref_ptr< Interface >::ref_ptr ( ref_ptr< Interface > const aOther)
inlinenoexcept

Definition at line 205 of file reference_counted.hpp.

◆ ref_ptr() [4/15]

template<typename Interface >
neolib::ref_ptr< Interface >::ref_ptr ( ref_ptr< Interface > &&  aOther)
inlinenoexcept

Definition at line 211 of file reference_counted.hpp.

◆ ref_ptr() [5/15]

template<typename Interface >
neolib::ref_ptr< Interface >::ref_ptr ( ref_ptr< Interface > const aOther,
Interface *  aPtr 
)
inlinenoexcept

Definition at line 216 of file reference_counted.hpp.

◆ ref_ptr() [6/15]

template<typename Interface >
neolib::ref_ptr< Interface >::ref_ptr ( ref_ptr< Interface > &&  aOther,
Interface *  aPtr 
)
inlinenoexcept

Definition at line 222 of file reference_counted.hpp.

◆ ref_ptr() [7/15]

template<typename Interface >
neolib::ref_ptr< Interface >::ref_ptr ( abstract_type const aOther,
Interface *  aPtr 
)
inlinenoexcept

Definition at line 227 of file reference_counted.hpp.

◆ ref_ptr() [8/15]

template<typename Interface >
neolib::ref_ptr< Interface >::ref_ptr ( abstract_type const aOther)
inlinenoexcept

Definition at line 233 of file reference_counted.hpp.

◆ ref_ptr() [9/15]

template<typename Interface >
neolib::ref_ptr< Interface >::ref_ptr ( i_discoverable aDiscoverable)
inline

Definition at line 239 of file reference_counted.hpp.

◆ ref_ptr() [10/15]

template<typename Interface >
template<typename Interface2 , typename = std::enable_if_t<std::is_base_of_v<Interface, Interface2>, sfinae>>
neolib::ref_ptr< Interface >::ref_ptr ( ref_ptr< Interface2 > const aOther)
inlinenoexcept

Definition at line 246 of file reference_counted.hpp.

◆ ref_ptr() [11/15]

template<typename Interface >
template<typename Interface2 , typename = std::enable_if_t<std::is_base_of_v<Interface, Interface2>, sfinae>>
neolib::ref_ptr< Interface >::ref_ptr ( ref_ptr< Interface2 > &&  aOther)
inlinenoexcept

Definition at line 253 of file reference_counted.hpp.

◆ ref_ptr() [12/15]

template<typename Interface >
template<typename Interface2 , typename = std::enable_if_t<std::is_base_of_v<Interface, Interface2>, sfinae>>
neolib::ref_ptr< Interface >::ref_ptr ( i_ref_ptr< Interface2 > const aOther)
inlinenoexcept

Definition at line 259 of file reference_counted.hpp.

◆ ref_ptr() [13/15]

template<typename Interface >
template<typename Interface2 >
neolib::ref_ptr< Interface >::ref_ptr ( ref_ptr< Interface2 > const aOther,
Interface *  aPtr 
)
inlinenoexcept

Definition at line 266 of file reference_counted.hpp.

◆ ref_ptr() [14/15]

template<typename Interface >
template<typename Interface2 >
neolib::ref_ptr< Interface >::ref_ptr ( ref_ptr< Interface2 > &&  aOther,
Interface *  aPtr 
)
inlinenoexcept

Definition at line 273 of file reference_counted.hpp.

◆ ref_ptr() [15/15]

template<typename Interface >
template<typename Interface2 >
neolib::ref_ptr< Interface >::ref_ptr ( i_ref_ptr< Interface2 > const aOther,
Interface *  aPtr 
)
inlinenoexcept

Definition at line 279 of file reference_counted.hpp.

◆ ~ref_ptr()

template<typename Interface >
neolib::ref_ptr< Interface >::~ref_ptr ( )
inline

Definition at line 285 of file reference_counted.hpp.

Member Function Documentation

◆ as()

template<typename Interface >
template<typename Interface2 >
ref_ptr< Interface2 > neolib::ref_ptr< Interface >::as ( )
inline

Definition at line 342 of file reference_counted.hpp.

◆ detach()

template<typename Interface >
Interface * neolib::ref_ptr< Interface >::detach ( )
inlineoverridevirtualnoexcept

◆ managed_ptr()

template<typename Interface >
Interface * neolib::ref_ptr< Interface >::managed_ptr ( ) const
inlineoverridevirtualnoexcept

◆ managing()

template<typename Interface >
bool neolib::ref_ptr< Interface >::managing ( ) const
inlineoverridevirtualnoexcept

◆ operator*()

template<typename Interface >
Interface & neolib::ref_ptr< Interface >::operator* ( ) const
inlineoverridevirtual

◆ operator->()

template<typename Interface >
Interface * neolib::ref_ptr< Interface >::operator-> ( ) const
inlineoverridevirtual

◆ operator=() [1/7]

template<typename Interface >
ref_ptr & neolib::ref_ptr< Interface >::operator= ( abstract_type const aOther)
inline

Definition at line 309 of file reference_counted.hpp.

◆ operator=() [2/7]

template<typename Interface >
template<typename Interface2 , typename = std::enable_if_t<std::is_base_of_v<Interface, Interface2>, sfinae>>
ref_ptr & neolib::ref_ptr< Interface >::operator= ( i_ref_ptr< Interface2 > const aOther)
inline

Definition at line 330 of file reference_counted.hpp.

◆ operator=() [3/7]

template<typename Interface >
ref_ptr & neolib::ref_ptr< Interface >::operator= ( ref_ptr< Interface > &&  aOther)
inline

Definition at line 301 of file reference_counted.hpp.

◆ operator=() [4/7]

template<typename Interface >
ref_ptr & neolib::ref_ptr< Interface >::operator= ( ref_ptr< Interface > const aOther)
inline

Definition at line 294 of file reference_counted.hpp.

◆ operator=() [5/7]

template<typename Interface >
template<typename Interface2 , typename = std::enable_if_t<std::is_base_of_v<Interface, Interface2>, sfinae>>
ref_ptr & neolib::ref_ptr< Interface >::operator= ( ref_ptr< Interface2 > &&  aOther)
inline

Definition at line 323 of file reference_counted.hpp.

◆ operator=() [6/7]

template<typename Interface >
template<typename Interface2 , typename = std::enable_if_t<std::is_base_of_v<Interface, Interface2>, sfinae>>
ref_ptr & neolib::ref_ptr< Interface >::operator= ( ref_ptr< Interface2 > const aOther)
inline

Definition at line 317 of file reference_counted.hpp.

◆ operator=() [7/7]

template<typename Interface >
ref_ptr & neolib::ref_ptr< Interface >::operator= ( std::nullptr_t  )
inline

Definition at line 335 of file reference_counted.hpp.

◆ ptr()

template<typename Interface >
Interface * neolib::ref_ptr< Interface >::ptr ( ) const
inlineoverridevirtualnoexcept

◆ reference_counted()

template<typename Interface >
bool neolib::ref_ptr< Interface >::reference_counted ( ) const
inlineoverridevirtualnoexcept

◆ release()

template<typename Interface >
Interface * neolib::ref_ptr< Interface >::release ( )
inlineoverridevirtual

◆ reset() [1/5]

template<typename Interface >
void neolib::ref_ptr< Interface >::reset ( )
inlineoverridevirtual

◆ reset() [2/5]

template<typename Interface >
void neolib::ref_ptr< Interface >::reset ( abstract_t< Interface > *  aPtr)
inlineoverridevirtual

◆ reset() [3/5]

template<typename Interface >
void neolib::ref_ptr< Interface >::reset ( abstract_t< Interface > *  aPtr,
abstract_t< Interface > *  aManagedPtr 
)
inlineoverridevirtual

◆ reset() [4/5]

template<typename Interface >
void neolib::ref_ptr< Interface >::reset ( abstract_t< Interface > *  aPtr,
abstract_t< Interface > *  aManagedPtr,
bool  aReferenceCounted,
bool  aAddRef 
)
inlineoverridevirtual

◆ reset() [5/5]

template<typename Interface >
template<typename Interface2 = Interface, typename = std::enable_if_t<std::is_base_of_v<Interface2, Interface>, sfinae>>
void neolib::ref_ptr< Interface >::reset ( Interface2 aPtr,
Interface2 aManagedPtr,
bool  aReferenceCounted,
bool  aAddRef 
)
inline

Definition at line 421 of file reference_counted.hpp.

◆ use_count()

template<typename Interface >
int32_t neolib::ref_ptr< Interface >::use_count ( ) const
inlineoverridevirtualnoexcept

◆ valid()

template<typename Interface >
bool neolib::ref_ptr< Interface >::valid ( ) const
inlineoverridevirtualnoexcept

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