A templated smart pointer class. More...
#include <vil_fwd.h>

Public Member Functions | |
| vil_smart_ptr () | |
| vil_smart_ptr (vil_smart_ptr< T > const &p) | |
| vil_smart_ptr (T *p) | |
| ~vil_smart_ptr () | |
| vil_smart_ptr< T > & | operator= (vil_smart_ptr< T > const &r) |
| Assignment. More... | |
| vil_smart_ptr< T > & | operator= (T *r) |
| operator bool () const | |
| Cast to bool. More... | |
| bool | operator! () const |
| Inverse bool. More... | |
| T & | operator * () const |
| Dereferencing the pointer. More... | |
| T * | operator -> () const |
| These methods all return the raw/dumb pointer. More... | |
| T * | ptr () const |
| These methods all return the raw/dumb pointer. More... | |
| T * | as_pointer () const |
| These methods all return the raw/dumb pointer. More... | |
| bool | operator== (T const *p) const |
| Do a shallow equality. More... | |
| bool | operator!= (T const *p) const |
| Do a shallow inequality. More... | |
| bool | operator== (vil_smart_ptr< T >const &p) const |
| Do a shallow equality. More... | |
| bool | operator!= (vil_smart_ptr< T >const &p) const |
| Do a shallow inequality. More... | |
| bool | operator< (vil_smart_ptr< T >const &p) const |
| bool | operator> (vil_smart_ptr< T >const &p) const |
| bool | operator<= (vil_smart_ptr< T >const &p) const |
| bool | operator>= (vil_smart_ptr< T >const &p) const |
Static Private Member Functions | |
| static void | ref (T *p) |
| static void | unref (T *p) |
Private Attributes | |
| T * | ptr_ |
| Pointer to object, or 0. More... | |
Related Functions | |
(Note that these are not member functions.) | |
| template<class T > | |
| void | vsl_b_write (vsl_b_ostream &os, const vil_smart_ptr< T > &v) |
| Binary save vil_smart_ptr to stream. More... | |
| template<class T > | |
| void | vsl_b_read (vsl_b_istream &is, vil_smart_ptr< T > &v) |
| Binary load vil_smart_ptr from stream. More... | |
| template<class T > | |
| void | vsl_print_summary (std::ostream &os, const vil_smart_ptr< T > &b) |
| Print human readable summary of object to a stream. More... | |
A templated smart pointer class.
This class requires that the class being templated over has the following signatures (methods) :
See also vbl_ref_count
|
inline |
Definition at line 41 of file vil_smart_ptr.h.
|
inline |
Definition at line 44 of file vil_smart_ptr.h.
|
inline |
Definition at line 47 of file vil_smart_ptr.h.
|
inline |
Definition at line 50 of file vil_smart_ptr.h.
|
inline |
These methods all return the raw/dumb pointer.
WARNING : Do not add an automatic cast to T*. This is intrinsically incorrect as you loose the smartness! In cases where you really need the pointer, it is better to be explicit about it and use one of the methods.
Definition at line 110 of file vil_smart_ptr.h.
|
inline |
Dereferencing the pointer.
Definition at line 96 of file vil_smart_ptr.h.
|
inline |
These methods all return the raw/dumb pointer.
Definition at line 99 of file vil_smart_ptr.h.
|
inlineexplicit |
Cast to bool.
Definition at line 88 of file vil_smart_ptr.h.
|
inline |
Inverse bool.
Definition at line 92 of file vil_smart_ptr.h.
|
inline |
Do a shallow inequality.
Do the smart pointers not point to the same object.
Definition at line 121 of file vil_smart_ptr.h.
|
inline |
Do a shallow inequality.
Do the smart pointers not point to the same object.
Definition at line 129 of file vil_smart_ptr.h.
|
inline |
Definition at line 130 of file vil_smart_ptr.h.
|
inline |
Definition at line 132 of file vil_smart_ptr.h.
|
inline |
Assignment.
Definition at line 61 of file vil_smart_ptr.h.
|
inline |
Definition at line 66 of file vil_smart_ptr.h.
|
inline |
Do a shallow equality.
Do they point to the same object.
Definition at line 117 of file vil_smart_ptr.h.
|
inline |
Do a shallow equality.
Do they point to the same object.
Definition at line 125 of file vil_smart_ptr.h.
|
inline |
Definition at line 131 of file vil_smart_ptr.h.
|
inline |
Definition at line 133 of file vil_smart_ptr.h.
|
inline |
These methods all return the raw/dumb pointer.
Definition at line 102 of file vil_smart_ptr.h.
|
staticprivate |
Definition at line 15 of file vil_smart_ptr.hxx.
|
staticprivate |
Definition at line 22 of file vil_smart_ptr.hxx.
|
related |
Binary load vil_smart_ptr from stream.
|
related |
Binary save vil_smart_ptr to stream.
|
related |
Print human readable summary of object to a stream.
|
private |
Pointer to object, or 0.
Definition at line 144 of file vil_smart_ptr.h.
1.8.15