SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWTPointer< Body > Class Template Reference

Base class for smart-pointer classes. More...

#include <rw/pointer/RWTPointer.h>

Inheritance diagram for RWTPointer< Body >:
RWTCountedPointer< Body > RWTCountingPointer< Body, Counter > RWTOnlyPointer< Body >

Public Types

typedef Body BodyType
 

Public Member Functions

 ~RWTPointer (void)
 
bool isValid (void) const
 
void swapWith (RWTPointer< Body > &second)
 
void validate (void) const
 

Protected Member Functions

 RWTPointer (Body *bodyP)
 
 RWTPointer (const RWTPointer< Body > &second)
 
 RWTPointer (RWStaticCtor)
 
 RWTPointer (void)
 
Body * get (void) const
 
RWTPointer< Body > & operator= (Body *ptr)
 

Friends

std::strong_ordering operator<=> (const RWTPointer &lhs, const Body *rhs)
 
std::strong_ordering operator<=> (const RWTPointer &lhs, const RWTPointer &rhs)
 
bool operator== (const RWTPointer &lhs, const Body *rhs)
 
bool operator== (const RWTPointer &lhs, const RWTPointer &rhs)
 

Detailed Description

template<class Body>
class RWTPointer< Body >

Base class for the smart-pointer classes in the Smart Pointer package.

Member Typedef Documentation

◆ BodyType

template<class Body >
typedef Body RWTPointer< Body >::BodyType

The type of the body.

Constructor & Destructor Documentation

◆ ~RWTPointer()

template<class Body >
RWTPointer< Body >::~RWTPointer ( void )

Destructor. Throws no exceptions.

◆ RWTPointer() [1/4]

template<class Body >
RWTPointer< Body >::RWTPointer ( void )
protected

Constructs a handle instance with a pointer value of rwnil. Throws no exceptions.

◆ RWTPointer() [2/4]

template<class Body >
RWTPointer< Body >::RWTPointer ( RWStaticCtor )
protected

Constructor for static pointers that may be used before constructed. Throws no exceptions.

◆ RWTPointer() [3/4]

template<class Body >
RWTPointer< Body >::RWTPointer ( Body * bodyP)
explicitprotected

Constructs a handle instance that points to the specified body. Throws no exceptions.

◆ RWTPointer() [4/4]

template<class Body >
RWTPointer< Body >::RWTPointer ( const RWTPointer< Body > & second)
protected

Constructs a handle instance that points to the same body as second. Throws no exceptions.

Member Function Documentation

◆ get()

template<class Body >
Body * RWTPointer< Body >::get ( void ) const
protected

Retrieves the handle's pointer value without validating it. Throws no exceptions.

◆ isValid()

template<class Body >
bool RWTPointer< Body >::isValid ( void ) const
inline

Returns true if the pointer is non-nil (rwnil). Otherwise, returns false. Throws no exceptions.

◆ operator=()

template<class Body >
RWTPointer< Body > & RWTPointer< Body >::operator= ( Body * ptr)
protected

Assigns a new pointer value to the handle. The parameter ptr is Body*. Throws no exceptions.

◆ swapWith()

template<class Body >
void RWTPointer< Body >::swapWith ( RWTPointer< Body > & second)

Swap bodies, if any, pointed to by this and second. Throws no exceptions.

◆ validate()

template<class Body >
void RWTPointer< Body >::validate ( void ) const
inline

Check if the pointer is valid. Throws an RWTHRInvalidPointer exception if the pointer is rwnil.

Friends And Related Symbol Documentation

◆ operator<=> [1/2]

template<class Body >
std::strong_ordering operator<=> ( const RWTPointer< Body > & lhs,
const Body * rhs )
friend

Performs a comparison of the pointer referred by lhs to rhs.

Note
If a compiler does not support rewritten expressions (i.e. before C++20), comparison operators are explicitly implemented to provide equivalent behavior.

◆ operator<=> [2/2]

template<class Body >
std::strong_ordering operator<=> ( const RWTPointer< Body > & lhs,
const RWTPointer< Body > & rhs )
friend

Performs a comparison of the pointer referred by lhs to rhs.

Note
If a compiler does not support rewritten expressions (i.e. before C++20), comparison operators are explicitly implemented to provide equivalent behavior.

◆ operator== [1/2]

template<class Body >
bool operator== ( const RWTPointer< Body > & lhs,
const Body * rhs )
friend

Returns true if lhs and rhs refer to the same pointer. Otherwise, returns false.

Note
If a compiler does not support rewritten expressions (i.e. before C++20), equality operators are explicitly implemented to provide equivalent behavior.

◆ operator== [2/2]

template<class Body >
bool operator== ( const RWTPointer< Body > & lhs,
const RWTPointer< Body > & rhs )
friend

Returns true if lhs and rhs refer to the same pointer. Otherwise, returns false.

Note
If a compiler does not support rewritten expressions (i.e. before C++20), equality operators are explicitly implemented to provide equivalent behavior.

Copyright © 2025 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.