![]() |
Qt 4.8
|
The QScopedArrayPointer class stores a pointer to a dynamically allocated array of objects, and deletes it upon destruction. More...
#include <qscopedpointer.h>
Public Functions | |
| T & | operator[] (int i) |
| Provides access to entry i of the scoped pointer's array of objects. More... | |
| const T & | operator[] (int i) const |
| Provides access to entry i of the scoped pointer's array of objects. More... | |
| QScopedArrayPointer () | |
| Constructs a QScopedArrayPointer instance. More... | |
| template<typename D > | |
| QScopedArrayPointer (D *p, typename QtPrivate::QScopedArrayEnsureSameType< T, D >::Type=0) | |
Public Functions inherited from QScopedPointer< T, Cleanup > | |
| T * | data () const |
| Returns the value of the pointer referenced by this object. More... | |
| bool | isNull () const |
Returns true if this object is holding a pointer that is null. More... | |
| operator bool () const | |
Returns true if this object is not null. More... | |
| bool | operator! () const |
Returns true if the pointer referenced by this object is null, otherwise returns false. More... | |
| T & | operator* () const |
| Provides access to the scoped pointer's object. More... | |
| T * | operator-> () const |
| Provides access to the scoped pointer's object. More... | |
| QScopedPointer (T *p=0) | |
| Constructs this QScopedPointer instance and sets its pointer to p. More... | |
| void | reset (T *other=0) |
| Deletes the existing object it is pointing to if any, and sets its pointer to other. More... | |
| void | swap (QScopedPointer< T, Cleanup > &other) |
| Swap this pointer with other. More... | |
| T * | take () |
| Returns the value of the pointer referenced by this object. More... | |
| ~QScopedPointer () | |
| Destroys this QScopedPointer object. More... | |
Private Functions | |
| QScopedArrayPointer (void *) | |
Additional Inherited Members | |
Public Types inherited from QScopedPointer< T, Cleanup > | |
| typedef T * | pointer |
Protected Variables inherited from QScopedPointer< T, Cleanup > | |
| T * | d |
The QScopedArrayPointer class stores a pointer to a dynamically allocated array of objects, and deletes it upon destruction.
A QScopedArrayPointer is a QScopedPointer that defaults to deleting the object it is pointing to with the delete[] operator. It also features operator[] for convenience, so we can write:
Definition at line 208 of file qscopedpointer.h.
|
inline |
Constructs a QScopedArrayPointer instance.
Definition at line 211 of file qscopedpointer.h.
|
inlineexplicit |
Definition at line 214 of file qscopedpointer.h.
|
inlineexplicitprivate |
Definition at line 230 of file qscopedpointer.h.
|
inline |
Provides access to entry i of the scoped pointer's array of objects.
If the contained pointer is null, behavior is undefined.
Definition at line 219 of file qscopedpointer.h.
|
inline |
Provides access to entry i of the scoped pointer's array of objects.
If the contained pointer is null, behavior is undefined.
Definition at line 224 of file qscopedpointer.h.