template <typename T>

class LocalPointerBase

Defined at line 68 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

"Smart pointer" base class; do not use directly: use LocalPointer etc.

Base class for smart pointer classes that do not throw exceptions.

Do not use this base class directly, since it does not delete its pointer.

A subclass must implement methods that delete the pointer:

Destructor and adoptInstead().

There is no operator T *() provided because the programmer must decide

whether to use getAlias() (without transfer of ownership) or orphan()

(with transfer of ownership and NULLing of the pointer).

Protected Members

T * ptr

Public Methods

void * operator new (size_t )

No heap allocation. Use only on the stack.

Defined at line 71 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

void * operator new[] (size_t )

Defined at line 72 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

void * operator new (size_t , void * )

Defined at line 74 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

void LocalPointerBase<T> (T * p)

Constructor takes ownership.

Parameters

p simple pointer to an object that is adopted ICU 4.4

Defined at line 82 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

void ~LocalPointerBase<T> ()

Destructor deletes the object it owns.

Subclass must override: Base class does nothing.

ICU 4.4

Defined at line 88 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

UBool isNull ()

nullptr check.

Returns

true if ==nullptr

ICU 4.4

Defined at line 94 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

UBool isValid ()

nullptr check.

Returns

true if !=nullptr

ICU 4.4

Defined at line 100 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

bool operator== (const T * other)

Comparison with a simple pointer, so that existing code

with ==nullptr need not be changed.

Parameters

other simple pointer for comparison

Returns

true if this pointer value equals other

ICU 4.4

Defined at line 108 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

bool operator!= (const T * other)

Comparison with a simple pointer, so that existing code

with !=nullptr need not be changed.

Parameters

other simple pointer for comparison

Returns

true if this pointer value differs from other

ICU 4.4

Defined at line 116 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

T * getAlias ()

Access without ownership change.

Returns

the pointer value

ICU 4.4

Defined at line 122 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

T & operator* ()

Access without ownership change.

Returns

the pointer value as a reference

ICU 4.4

Defined at line 128 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

T * operator-> ()

Access without ownership change.

Returns

the pointer value

ICU 4.4

Defined at line 134 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

T * orphan ()

Gives up ownership; the internal pointer becomes nullptr.

Returns

the pointer value;

caller becomes responsible for deleting the object

ICU 4.4

Defined at line 141 of file ../../third_party/icu/default/source/common/unicode/localpointer.h

void adoptInstead (T * p)

Deletes the object it owns,

and adopts (takes ownership of) the one passed in.

Subclass must override: Base class does not delete the object.

Parameters

p simple pointer to an object that is adopted ICU 4.4

Defined at line 153 of file ../../third_party/icu/default/source/common/unicode/localpointer.h