Base Class
#include <rw/pointer/RWTPointer.h>
This is an abstract base class for the smart-pointer classes in the Smart Pointer package.
RWTPointer(void);
Constructs a handle instance with a pointer value of rwnil. Throws no exceptions.
RWTPointer(Body* bodyP);
Constructs a handle instance that points to the specified body. Throws no exceptions.
RWTPointer(RWStaticCtor);
Constructor for static pointers that may be used before constructed. Throws no exceptions.
RWTPointer(const RWTPointer<Body>& second);
Constructs a handle instance that points to the same body as the second. Throws no exceptions.
~RWTPointer(void);
Destructor. Throws no exceptions.
typedef Body BodyType;
The type of the body.
RWBoolean operator!=(const Body* ptr) const;
Tests to see if this instance points to a different body than the argument. Throws no exceptions.
RWBoolean operator!=(const RWTPointer<Body>& second) const;
Tests to see if this instance points to a different body than the second instance points to. Throws no exceptions.
RWBoolean operator<(const RWTPointer<Body>& second) const;
Provides dummy less-than operator to allow smart-pointer classes to be used in stdlib-based collections. This member compares the body addresses and should be replaced in derived classes if other behavior is desired. Throws no exceptions.
RWBoolean operator==(const Body* ptr) const;
Tests to see if this instance points to the same body as the argument. Throws no exceptions.
RWBoolean operator==(const RWTPointer<Body>& second) const;
Tests to see if this instance points to the same body as the second instance. Throws no exceptions.
RWTPointer<Body>& operator=(Body* ptr);
Assigns a new pointer value to the handle. The parameter is Body*. Throws no exceptions.
RWBoolean isValid(void) const;
Returns TRUE if pointer is non-nil (rwnil); otherwise returns FALSE. Throws no exceptions.
void swapWith(RWTPointer<Body>& second);
Swap bodies, if any, with another handle. Throws no exceptions.
void validate(void) const;
Check if the pointer is valid, throwing an RWTHRInvalidPointer exception if the pointer is rwnil. Throws an RWTHRInvalidPointer exception.
Body* get(void) const;
Retrieves the handle's pointer value without validating it. Throws no exceptions.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.