|
| SmartI () |
| Default constructor initializes to NULL interface.
|
|
| SmartI (TInterface *iInterface) |
| Constructor won't do an extra AddRef() on construction but will Release() on destruction.
|
|
| SmartI (const TSelf &iOther) |
| Copy constructor performs AddRef() on interface.
|
|
| SmartI (TSelf &&iOther) noexcept |
| Move constructor.
|
|
| ~SmartI () |
| Destructor performs Release() on interface.
|
|
void | reset () |
| Reinitialize to NULL interface.
|
|
void | reset (TInterface *iInterface) |
| Reinitialize to an interface, performs no AddRef on new interface, but will Release() it in destructor.
|
|
TSelf & | operator= (const TSelf &iOther) |
| assign the SmartI to another one, performing AddRef() on interface.
|
|
TSelf & | operator= (TSelf &&iOther) noexcept |
| Move assignment.
|
|
TPointer | get () const |
| return pointer to interface
|
|
TPointer | operator-> () const |
| access pointee as a pointer
|
|
TAddress | address () |
| access address of interface pointer.
|
|
bool | isEmpty () const |
| return true if pointer doesn't own any interface.
|
|
bool | operator! () const |
| return true if pointer doesn't own any interface (same as isEmpty).
|
|
| operator bool () const |
| evaluates to true if pointer owns an interface (only in boolean context)
|
|
void | swap (TSelf &iOther) |
| exchange the pointees (and there reference counts) between two shared pointers
|
|
template<typename I>
class lass::util::SmartI< I >
smart pointer to COM interfaces
- Author
- Bram de Greve [Bramz]
Requirements for COM interface
COM interface I must implement two methods AddRef()
and Release()
:
AddRef()
should increase reference count to interface
Release()
should decrease reference count
Definition at line 66 of file smart_i.h.