library of assembled shared sources |
http://lass.cocamware.com |
#include <smart_i.h>
Data Structures | |
struct | Rebind |
Rebind to another interface type. More... | |
Public Types | |
typedef SmartI< I > | TSelf |
type of *this | |
typedef I | TInterface |
typedef I * | TPointer |
typedef I ** | TAddress |
Public Member Functions | |
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 () | |
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. | |
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 num::SafeBool () 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 | |
Private Member Functions | |
void | safeAddRef () |
void | safeRelease () |
Private Attributes | |
TPointer | interface_ |
AddRef()
and Release()
:AddRef()
should increase reference count to interfaceRelease()
should decrease reference count Definition at line 67 of file smart_i.h.
typedef SmartI<I> lass::util::SmartI< I >::TSelf |
typedef I lass::util::SmartI< I >::TInterface |
typedef I* lass::util::SmartI< I >::TPointer |
typedef I** lass::util::SmartI< I >::TAddress |
lass::util::SmartI< I >::SmartI | ( | ) | [inline] |
lass::util::SmartI< I >::SmartI | ( | TInterface * | iInterface | ) | [inline, explicit] |
lass::util::SmartI< I >::SmartI | ( | const TSelf & | iOther | ) | [inline] |
Copy constructor performs AddRef() on interface.
Definition at line 104 of file smart_i.h.
References lass::util::SmartI< I >::safeAddRef().
lass::util::SmartI< I >::~SmartI | ( | ) | [inline] |
Destructor performs Release() on interface.
Definition at line 112 of file smart_i.h.
References lass::util::SmartI< I >::safeRelease().
void lass::util::SmartI< I >::reset | ( | ) | [inline] |
Reinitialize to NULL interface.
Performs Release() on old interface.
Definition at line 120 of file smart_i.h.
References lass::util::SmartI< I >::swap().
void lass::util::SmartI< I >::reset | ( | TInterface * | iInterface | ) | [inline] |
Reinitialize to an interface, performs no AddRef on new interface, but will Release() it in destructor.
Performs Release() on old interface.
Definition at line 130 of file smart_i.h.
References lass::util::SmartI< I >::swap().
TSelf& lass::util::SmartI< I >::operator= | ( | const TSelf & | iOther | ) | [inline] |
assign the SmartI to another one, performing AddRef() on interface.
Definition at line 138 of file smart_i.h.
References lass::util::SmartI< I >::swap().
TPointer lass::util::SmartI< I >::get | ( | ) | const [inline] |
return pointer to interface
Definition at line 147 of file smart_i.h.
References lass::util::SmartI< I >::interface_.
TPointer lass::util::SmartI< I >::operator-> | ( | ) | const [inline] |
access pointee as a pointer
Definition at line 154 of file smart_i.h.
References lass::util::SmartI< I >::interface_, and LASS_ASSERT.
TAddress lass::util::SmartI< I >::address | ( | ) | [inline] |
access address of interface pointer.
Definition at line 162 of file smart_i.h.
References lass::util::SmartI< I >::interface_.
bool lass::util::SmartI< I >::isEmpty | ( | ) | const [inline] |
return true if pointer doesn't own any interface.
Definition at line 170 of file smart_i.h.
References lass::util::SmartI< I >::interface_.
bool lass::util::SmartI< I >::operator! | ( | ) | const [inline] |
return true if pointer doesn't own any interface (same as isEmpty).
Definition at line 178 of file smart_i.h.
References lass::util::SmartI< I >::interface_.
lass::util::SmartI< I >::operator num::SafeBool | ( | ) | const [inline] |
evaluates to true if pointer owns an interface (only in boolean context)
Definition at line 187 of file smart_i.h.
References lass::util::SmartI< I >::interface_, lass::num::safeFalse, and lass::num::safeTrue.
void lass::util::SmartI< I >::swap | ( | TSelf & | iOther | ) | [inline] |
exchange the pointees (and there reference counts) between two shared pointers
Definition at line 194 of file smart_i.h.
References lass::util::SmartI< I >::interface_, and std::swap().
Referenced by lass::util::SmartI< I >::operator=(), and lass::util::SmartI< I >::reset().
void lass::util::SmartI< I >::safeAddRef | ( | ) | [inline, private] |
void lass::util::SmartI< I >::safeRelease | ( | ) | [inline, private] |
TPointer lass::util::SmartI< I >::interface_ [private] |
Definition at line 218 of file smart_i.h.
Referenced by lass::util::SmartI< I >::address(), lass::util::SmartI< I >::get(), lass::util::SmartI< I >::isEmpty(), lass::util::SmartI< I >::operator num::SafeBool(), lass::util::SmartI< I >::operator!(), lass::util::SmartI< I >::operator->(), and lass::util::SmartI< I >::swap().
Generated on Mon Nov 10 14:22:17 2008 for Library of Assembled Shared Sources by 1.5.7.1 |