rcolyer.net
RC Lib  Version 202403231100
Public Member Functions | List of all members
RC::Ptr< T > Class Template Reference

A safe pointer class that throws an RC::ErrorMsgNull if a null dereference is attempted. More...

#include <Ptr.h>

Public Member Functions

 Ptr (T *t_ptr=NULL)
 Default constructor assigning the value of the pointer. More...
 
template<class Tderived >
 Ptr (const APtr< Tderived > &other)
 A constructor which obtains a non-reference-counted copy of an APtr. More...
 
template<class Tderived >
 Ptr (const RevPtr< Tderived > &other)
 A constructor which obtains a non-revokable copy of a RevPtr. More...
 
template<class Tderived >
 Ptr (const Ptr< Tderived > &other)
 Copy constructor. More...
 
void Delete ()
 Deletes the object being pointed to and nulls the pointer.
 
T * Raw () const
 Returns a direct reference to the enclosed pointer. More...
 

Detailed Description

template<class T>
class RC::Ptr< T >

A safe pointer class that throws an RC::ErrorMsgNull if a null dereference is attempted.

See also
APtr
RevPtr

Constructor & Destructor Documentation

◆ Ptr() [1/4]

template<class T >
RC::Ptr< T >::Ptr ( T *  t_ptr = NULL)
inline

Default constructor assigning the value of the pointer.

Parameters
t_ptrThe new pointer value.

◆ Ptr() [2/4]

template<class T >
template<class Tderived >
RC::Ptr< T >::Ptr ( const APtr< Tderived > &  other)
inline

A constructor which obtains a non-reference-counted copy of an APtr.

Parameters
otherThe APtr from which a pointer should be extracted.

◆ Ptr() [3/4]

template<class T >
template<class Tderived >
RC::Ptr< T >::Ptr ( const RevPtr< Tderived > &  other)
inline

A constructor which obtains a non-revokable copy of a RevPtr.

Parameters
otherThe RevPtr from which a pointer should be extracted.

◆ Ptr() [4/4]

template<class T >
template<class Tderived >
RC::Ptr< T >::Ptr ( const Ptr< Tderived > &  other)
inline

Copy constructor.

Parameters
otherThe Ptr to copy.

Member Function Documentation

◆ Raw()

template<class T >
T* RC::Ptr< T >::Raw ( ) const
inline

Returns a direct reference to the enclosed pointer.

The reference is read/write, so it can be used as a function parameter which updates the value of this pointer.

Returns
A reference to the enclosed pointer.

The documentation for this class was generated from the following file:
email address
— (c) 2015