|
Teamcenter C++ API Reference
2312
|
Template class that stores a pointer pointing to memory allocated using some SM (Storage Management module from NX) allocation API. It ensures that memory is freed automatically when the instance of this class goes out of scope. More...
#include <ScopedSmPtr.hxx>
Public Member Functions | |
| T * | get () const |
| T *& | getReference () |
| const T * | getString () const |
| bool | operator! () const |
| bool | operator!= (const T *t) const |
| T ** | operator& () |
| T & | operator* () const |
| T * | operator-> () const |
| scoped_smptr & | operator= (T *ptr) |
| bool | operator== (const T *t) const |
| const T & | operator[] (std::size_t inx) const |
| T & | operator[] (std::size_t inx) |
| const T & | operator[] (int inx) const |
| T & | operator[] (int inx) |
| const T & | operator[] (unsigned int inx) const |
| T & | operator[] (unsigned int inx) |
| const T & | operator[] (short inx) const |
| T & | operator[] (short inx) |
| const T & | operator[] (long inx) const |
| T & | operator[] (long inx) |
| T * | release () |
| scoped_smptr (T *b=0) | |
| virtual | ~scoped_smptr () |
Protected Attributes | |
| T * | bucket |
Private Member Functions | |
| scoped_smptr & | operator= (const scoped_smptr &) |
| scoped_smptr (const scoped_smptr &) | |
Template class that stores a pointer pointing to memory allocated using some SM (Storage Management module from NX) allocation API. It ensures that memory is freed automatically when the instance of this class goes out of scope.
Allocation scheme: scoped_smptr requires that memory be allocated via SM (Storage Management module from NX) API (e.g. MEM_alloc, etc.).
2) scoped_smptr cannot be used for a class which uses SM memory via 'operator new' override.
Though the memory may be freed OK, the destructor wont be called and may lead to issues.
Definition at line 89 of file ScopedSmPtr.hxx.
|
inlineexplicit |
Constructor. Note that no conversion will be allowed: the pointer needs to be of the specified type (T).
Definition at line 96 of file ScopedSmPtr.hxx.
|
inlinevirtual |
Default destructor. It also deletes the object to which it points.
Definition at line 101 of file ScopedSmPtr.hxx.
|
private |
Prevention of usage of the copy constructor.
|
inline |
Returns the pointed memory.
Definition at line 194 of file ScopedSmPtr.hxx.
|
inline |
Returns the reference of pointed memory.
Definition at line 189 of file ScopedSmPtr.hxx.
|
inline |
Safe getter of the string of elements of type T.
It returns the memory pointed by this object, or a pointer to a default constructed element if the object does not point to any memory.
This is particularly useful if the object manages memory of a C-string, because it can be used for a NULL-safe assignment to a std::string.
Definition at line 184 of file ScopedSmPtr.hxx.
|
inline |
Unary NOT operator
Definition at line 208 of file ScopedSmPtr.hxx.
|
inline |
Operator !=
Definition at line 205 of file ScopedSmPtr.hxx.
|
inline |
Operator &
Definition at line 114 of file ScopedSmPtr.hxx.
|
inline |
Operator *
Definition at line 119 of file ScopedSmPtr.hxx.
|
inline |
Operator ->
Definition at line 124 of file ScopedSmPtr.hxx.
|
inline |
Operator =
If the scoped pointer was already assigned, the current assignment is removed (memory is freed) and replaced with the requested pointed.
Definition at line 109 of file ScopedSmPtr.hxx.
|
private |
Prevention of usage of the operator =
|
inline |
Operator ==
Definition at line 202 of file ScopedSmPtr.hxx.
|
inline |
Operator []
Definition at line 129 of file ScopedSmPtr.hxx.
|
inline |
Operator []
Definition at line 134 of file ScopedSmPtr.hxx.
|
inline |
Operator []
Definition at line 139 of file ScopedSmPtr.hxx.
|
inline |
Operator []
Definition at line 144 of file ScopedSmPtr.hxx.
|
inline |
Operator []
Definition at line 149 of file ScopedSmPtr.hxx.
|
inline |
Operator []
Definition at line 154 of file ScopedSmPtr.hxx.
|
inline |
Operator []
Definition at line 159 of file ScopedSmPtr.hxx.
|
inline |
Operator []
Definition at line 164 of file ScopedSmPtr.hxx.
|
inline |
Operator []
Definition at line 169 of file ScopedSmPtr.hxx.
|
inline |
Operator []
Definition at line 174 of file ScopedSmPtr.hxx.
|
inline |
Returns the memory that has been managed by the smart pointer, and ends its management of this memory.
Definition at line 199 of file ScopedSmPtr.hxx.
|
protected |
The managed pointer.
Definition at line 217 of file ScopedSmPtr.hxx.