|
Pallas Solver
0.1
C++ Global Optimization Algorithms
|
#include <scoped_ptr.h>
Public Types | |
| typedef C | element_type |
Public Member Functions | |
| scoped_array (C *p=NULL) | |
| Constructor. More... | |
| ~scoped_array () | |
| Destructor. More... | |
| void | reset (C *p=NULL) |
| Deletes the current owned object, if any. More... | |
| C & | operator[] (std::ptrdiff_t i) const |
| Get one element of the current object. More... | |
| C * | get () const |
| Get a pointer to the zeroth element of the current object. More... | |
| bool | operator== (const C *p) const |
| bool | operator!= (const C *p) const |
| void | swap (scoped_array &p2) |
| C * | release () |
| Release an array.]. More... | |
scoped_array<C> is like scoped_ptr<C>, except that the caller must allocate with new [] and the destructor deletes objects with delete [].
As with scoped_ptr<C>, a scoped_array<C> either points to an object or is NULL. A scoped_array<C> owns the object that it points to. scoped_array<T> is thread-compatible, and once you index into it, the returned objects have only the threadsafety guarantees of T.
Size: sizeof(scoped_array<C>) == sizeof(C*)
| typedef C pallas::scoped_array< C >::element_type |
The element type
|
inlineexplicit |
Constructor.
Defaults to intializing with NULL. There is no way to create an uninitialized scoped_array. The input parameter must be allocated with new [].
|
inline |
Destructor.
If there is a C object, delete it. We don't need to test ptr_ == NULL because C++ does that for us.
|
inline |
Get a pointer to the zeroth element of the current object.
If there is no current object, return NULL.

|
inline |
Returns whether a scoped_array and a raw pointer refer to different arrays.
|
inline |
Returns whether a scoped_array and a raw pointer refer to the same array, not just to two different but equal arrays.
|
inline |
Get one element of the current object.
Will assert() if there is no current object, or index i is negative.
|
inline |
Release an array.].
The return value is the current pointer held by this object. If this object holds a NULL pointer, the return value is NULL. After this operation, this object will hold a NULL pointer, and will not own the object any more.

|
inline |
Deletes the current owned object, if any.
Takes ownership of a new object, if given. this->reset(this->get()) works.
|
inline |
Swap two scoped arrays.]

1.8.11