Go to the documentation of this file.
40 template <
class OTHER>
42 if ( ptr )
reset( ptr );
51 rhs.m_interface =
nullptr;
64 inline SmartIF( std::unique_ptr<T>&& rhs ) {
65 reset( rhs.release() );
71 inline explicit operator bool()
const {
return isValid(); }
88 inline void reset( TYPE* ptr =
nullptr ) {
96 template <
class OTHER>
97 inline void reset( OTHER* ptr ) {
109 template <
typename IFace>
142 template <
typename IFace>
TYPE & operator*() const
Dereference operator.
void reset(OTHER *ptr)
Set the internal pointer to the passed one disposing of the old one.
SmartIF(std::unique_ptr< T > &&rhs)
SmartIF & operator=(IInterface *ptr)
Assignment operator from IInterface pointer.
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
SmartIF & operator=(SmartIF &&rhs)
SmartIF & operator=(const SmartIF< T > &rhs)
Assignment operator from a different SmartIF.
SmartIF(OTHER *ptr)
Standard constructor from any (IInterface-derived) pointer.
bool isValid() const
Allow for check if smart pointer is valid.
SmartIF(const SmartIF &rhs)
TYPE * m_interface
Pointer to the instance.
SmartIF(TYPE *ptr)
Standard constructor from pointer.
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
SmartIF< IFace > make_SmartIF(IFace *iface)
TYPE * get() const
Get interface pointer.
TYPE * operator->() const
Dereference operator.
SmartIF(const SmartIF< T > &rhs)
Constructor from another SmartIF, with a different type.
SmartIF & operator=(const SmartIF &rhs)
Assignment operator.