|
ICU 55.1
55.1
|
"Smart pointer" class, deletes objects via the C++ array delete[] operator. More...
#include <localpointer.h>
Public Member Functions | |
| LocalArray (T *p=NULL) | |
| Constructor takes ownership. | |
| ~LocalArray () | |
| Destructor deletes the array it owns. | |
| void | adoptInstead (T *p) |
| Deletes the array it owns, and adopts (takes ownership of) the one passed in. | |
| T & | operator[] (ptrdiff_t i) const |
| Array item access (writable). | |
Public Member Functions inherited from icu::LocalPointerBase< T > | |
| LocalPointerBase (T *p=NULL) | |
| Constructor takes ownership. | |
| ~LocalPointerBase () | |
| Destructor deletes the object it owns. | |
| UBool | isNull () const |
| NULL check. | |
| UBool | isValid () const |
| NULL check. | |
| bool | operator== (const T *other) const |
| Comparison with a simple pointer, so that existing code with ==NULL need not be changed. | |
| bool | operator!= (const T *other) const |
| Comparison with a simple pointer, so that existing code with !=NULL need not be changed. | |
| T * | getAlias () const |
| Access without ownership change. | |
| T & | operator* () const |
| Access without ownership change. | |
| T * | operator-> () const |
| Access without ownership change. | |
| T * | orphan () |
| Gives up ownership; the internal pointer becomes NULL. | |
Additional Inherited Members | |
Protected Attributes inherited from icu::LocalPointerBase< T > | |
| T * | ptr |
| Actual pointer. | |
"Smart pointer" class, deletes objects via the C++ array delete[] operator.
For most methods see the LocalPointerBase base class. Adds operator[] for array item access.
Usage example:
Definition at line 280 of file localpointer.h.
|
inlineexplicit |
Constructor takes ownership.
| p | simple pointer to an array of T objects that is adopted |
Definition at line 287 of file localpointer.h.
|
inline |
|
inline |
Deletes the array it owns, and adopts (takes ownership of) the one passed in.
| p | simple pointer to an array of T objects that is adopted |
Reimplemented from icu::LocalPointerBase< T >.
Definition at line 301 of file localpointer.h.
|
inline |
Array item access (writable).
No index bounds check.
| i | array index |
Definition at line 312 of file localpointer.h.
1.8.1.2