|
|
| hp (const T *pT) |
| |
|
template<class X > |
| | hp (const X *pX) |
| |
|
| hp (const hp< T > &rhpT) |
| |
|
template<class X > |
| | hp (const sp< X > &rspX) |
| |
|
template<class X > |
| | hp (const hp< X > &rhpX) |
| |
| void | initialize (T *pObject) |
| | Initialize during Handled construction. More...
|
| |
| template<class X > |
| const hp< T > & | operator= (const sp< X > &rspX) |
| | Converts from a smart pointer of any type. More...
|
| |
|
template<class X > |
| const hp< T > & | operator= (const X *pX) |
| |
|
hp< T > & | operator= (const hp< T > &rhpT) |
| |
|
BWORD | operator< (const hp< T > &rhpT) const |
| |
| T * | raw (void) const |
| | Returns the handled pointer, potentially NULL. More...
|
| |
| T * | operator-> (void) const |
| | Use the handled pointer. More...
|
| |
| T & | operator* (void) const |
| | Dereference to the handled pointer. More...
|
| |
| sp< T > | object (void) const |
| | Returns a smart pointer of the same templated type. More...
|
| |
| BWORD | isValid (void) const |
| | Returns true if the pointer is set. More...
|
| |
| BWORD | isNull (void) const |
| | Returns true if the pointer is not set. More...
|
| |
| void | invalidate (void) |
| | Nulls the shared pointer. More...
|
| |
| HandleToken * | handleToken (void) const |
| | Access the shared token. More...
|
| |
|
(Note that these are not member functions.)
|
| template<class T , class X > |
| BWORD | operator== (const hp< T > &rhpLeft, const hp< X > &rhpRight) |
| |
| template<class T , class X > |
| BWORD | operator== (const hp< T > &rhpLeft, const sp< X > &rspRight) |
| |
| template<class T , class X > |
| BWORD | operator== (const sp< X > &rspLeft, const hp< T > &rhpRight) |
| |
| template<class T > |
| BWORD | operator!= (const hp< T > &rhpLeft, const hp< T > &rhpRight) |
| |
| template<class T , class X > |
| BWORD | operator!= (const hp< T > &rhpLeft, const sp< X > &rspRight) |
| |
| template<class T , class X > |
| BWORD | operator!= (const sp< X > &rspLeft, const hp< T > &rhpRight) |
| |
template<class T>
class fe::hp< T >
Safe handle for shared pointer.
Unlike sp<>, the pointed to object can easily become invalid since the handle's existance doesn't prop up the object's existance. Unless there is another mechanism, such as a known sp<>, that is known to guarantee the object's persistence, it would be wise to judiciously verify currency with isValid().
A hp<> can be automatically cast to a sp<> (smart pointer).
A sp<> based on a Handled object can be automatically cast to a hp<>.