template
class
OwnPtr<class>
(Return to index)
A pointer which owns the object pointed at.
When the pointer goes out of scope, the pointee is deleted.
When an OwnPtr is assigned the ownership is transferred to the target.
Type: |
Instantiable |
Include file: |
./MemoryManagement/OwnPtr.hh |
Synopsis (including inherited members):
Documentation:
- Public members:
-
OwnPtr
()
;
- Default constructor.
Set the pointer to NULL.
-
OwnPtr
(const OwnPtr&)
;
- Copy constructor.
Transmits ownership.
-
OwnPtr
(Object*)
;
- Constructor.
Construct pointer to an object just created by "new". Grabs ownership.
-
bool isValid
()const
;
- Test for validity.
Return true, if the pointer is not NULL.
-
Object& operator*
()const
;
- Dereferencing operator.
Return a reference to the object.
-
Object* operator->
()const
;
- Delegation operator.
Return a C-type pointer to the object.
-
OwnPtr& operator=
(const OwnPtr&)
;
- Assign.
Transmit ownership to copy.
-
OwnPtr& operator=
(Object*)
;
- Assign.
Grab the ownership of an object just created by "new".
-
Object* release
()
;
- Release ownership.
Return built-in pointer.
The calling program must take over the ownership.
-
~OwnPtr
()
;
- Destructor.
Delete the pointed-at object, if the pointer is non-null.
Documentation generated by fci on Mon Feb 7 11:41:47 2000