![]() |
The Gaudi Framework
master (ff829712)
|
Small smart pointer class with automatic reference counting for IInterface. More...
#include <GaudiKernel/SmartIF.h>
Public Member Functions | |
SmartIF ()=default | |
SmartIF (TYPE *ptr) | |
Standard constructor from pointer. | |
template<class OTHER> | |
SmartIF (OTHER *ptr) | |
Standard constructor from any (IInterface-derived) pointer. | |
SmartIF (const SmartIF &rhs) | |
SmartIF (SmartIF &&rhs) | |
SmartIF & | operator= (SmartIF &&rhs) |
template<class T> | |
SmartIF (const SmartIF< T > &rhs) | |
Constructor from another SmartIF, with a different type. | |
~SmartIF () | |
template<class T> | |
SmartIF (std::unique_ptr< T > &&rhs) | |
bool | isValid () const |
Allow for check if smart pointer is valid. | |
operator bool () const | |
bool | operator! () const |
operator TYPE * () const | |
Automatic conversion to pointer. | |
TYPE * | operator-> () const |
Dereference operator. | |
TYPE & | operator* () const |
Dereference operator. | |
TYPE * | get () const |
Get interface pointer. | |
void | reset (TYPE *ptr=nullptr) |
Set the internal pointer to the passed one disposing of the old one. | |
template<class OTHER> | |
void | reset (OTHER *ptr) |
Set the internal pointer to the passed one disposing of the old one. | |
template<typename IFace> | |
SmartIF< IFace > | as () const |
return a new SmartIF instance to another interface | |
SmartIF & | operator= (IInterface *ptr) |
Assignment operator from IInterface pointer. | |
SmartIF & | operator= (const SmartIF &rhs) |
Assignment operator. | |
template<class T> | |
SmartIF & | operator= (const SmartIF< T > &rhs) |
Assignment operator from a different SmartIF. | |
Private Attributes | |
TYPE * | m_interface = nullptr |
Pointer to the instance. | |
Small smart pointer class with automatic reference counting for IInterface.
SmartIF simplifies the interaction with components in Gaudi by implementing an automatic reference counting and the casting (via IInterface::queryInterface).
Standard constructor from pointer.
Definition at line 36 of file SmartIF.h.
Standard constructor from any (IInterface-derived) pointer.
Definition at line 41 of file SmartIF.h.
return a new SmartIF instance to another interface
Definition at line 71 of file SmartIF.h.
|
inline |
Assignment operator from IInterface pointer.
It allows things like SmartIF<T> x; x = 0;
Set the internal pointer to the passed one disposing of the old one.
Version for pointers of types inheriting from IInterface.
Definition at line 97 of file SmartIF.h.