#include <AutoPtr.hpp>
Public Types | |
typedef X | element_type |
Public Member Functions | |
AutoPtrVec (X *p=0) | |
Construct a new AutoPtrVec object that assumes ownership of a given array pointer. | |
~AutoPtrVec () | |
Destroy this AutoPtrVec object and the array it points to. | |
AutoPtrVec & | operator= (X *p) |
Assignment operator Assign a new array pointer to this AutoPtrVec object. | |
X & | operator * () const |
X * | operator-> () const |
X & | operator[] (unsigned n) |
const X & | operator[] (unsigned i) const |
X * | get () const |
X * | release () |
Release ownership of the underlying array. | |
void | reset (X *p=0) |
Delete the array the underlying pointer points to and take ownership of a new array pointer. | |
Private Member Functions | |
AutoPtrVec (const AutoPtrVec &a) | |
AutoPtrVec & | operator= (const AutoPtrVec &a) |
Private Attributes | |
X * | _ptr |
It stores a pointer to the array obtained by way of the new operator and deletes the array when the AutoPtrVec object is destroyed. The AutoPtrVec class provides semantics of strict ownership. After construction an AutoPtrVec object owns the array whose pointer it holds. When an instantiation of AutoPtrVec is copied, ownership of the array is transferred to the destination AutoPtrVec. The behavior is undefined if more than one instantiation of AutoPtrVec owns the same array at the same time.
Definition at line 183 of file AutoPtr.hpp.
|
Definition at line 193 of file AutoPtr.hpp. |
|
|
|
Construct a new AutoPtrVec object that assumes ownership of a given array pointer.
Definition at line 263 of file AutoPtr.hpp. |
|
Destroy this AutoPtrVec object and the array it points to.
Definition at line 277 of file AutoPtr.hpp. References BLOCXX_NAMESPACE::AutoPtrVec< X >::_ptr. |
|
Definition at line 296 of file AutoPtr.hpp. References BLOCXX_NAMESPACE::AutoPtrVec< X >::_ptr. Referenced by BLOCXX_NAMESPACE::String::concat(), BLOCXX_NAMESPACE::String::format(), BLOCXX_NAMESPACE::UnnamedPipe::readString(), and BLOCXX_NAMESPACE::String::String(). |
|
Definition at line 284 of file AutoPtr.hpp. References BLOCXX_NAMESPACE::AutoPtrVec< X >::_ptr. |
|
Definition at line 287 of file AutoPtr.hpp. References BLOCXX_NAMESPACE::AutoPtrVec< X >::_ptr. |
|
Assignment operator Assign a new array pointer to this AutoPtrVec object. If this AutoPtrVec object points to another array before this assignment, then that array will be destroyed first.
Definition at line 266 of file AutoPtr.hpp. References BLOCXX_NAMESPACE::AutoPtrVec< X >::_ptr, and BLOCXX_NAMESPACE::AutoPtrVec< X >::reset(). |
|
|
|
Definition at line 293 of file AutoPtr.hpp. References BLOCXX_NAMESPACE::AutoPtrVec< X >::_ptr. |
|
Definition at line 290 of file AutoPtr.hpp. References BLOCXX_NAMESPACE::AutoPtrVec< X >::_ptr. |
|
Release ownership of the underlying array.
Definition at line 299 of file AutoPtr.hpp. References BLOCXX_NAMESPACE::AutoPtrVec< X >::_ptr. Referenced by BLOCXX_NAMESPACE::UnnamedPipe::readString(). |
|
Delete the array the underlying pointer points to and take ownership of a new array pointer. This is similar to the assignment operator.
Definition at line 307 of file AutoPtr.hpp. References BLOCXX_NAMESPACE::AutoPtrVec< X >::_ptr. Referenced by BLOCXX_NAMESPACE::AutoPtrVec< X >::operator=(). |
|