rcolyer.net
RC Lib  Version 202403231100
Functions
PtrCommon.h File Reference

Common components for the *Ptr.h files. Do not include this directly. More...

Go to the source code of this file.

Functions

void Assert () const
 Throws RC::ErrorMsgNull if the pointer is null.
 
bool IsSet () const
 True if the pointer is non-NULL. More...
 
bool IsNull () const
 True if the pointer is NULL. More...
 
T & operator* ()
 Dereferences the pointer, or throws an exception if null. More...
 
T * operator-> ()
 Provides access to the enclosed pointer, or throws RC::ErrorMsgNull if null. More...
 
 operator T* () const
 Implicitly casts to the enclosed pointer, without null checking.
 
template<class Type >
Ptr< Type > Cast ()
 Dynamically casts to an RC::Ptr of the type used as a template parameter on this function. More...
 
template<class Type >
const Ptr< Type > Cast () const
 Const version of Cast()
 
template<class Type >
bool CanCast () const
 True if it can dynamically cast to this type.
 
template<class Type >
Type & As ()
 Dynamically casts and dereferences to the type presented as a template parameter, or throws ErrorMsgCast if it fails. More...
 
template<class Type >
const Type & As () const
 Const version of As()
 

Detailed Description

Common components for the *Ptr.h files. Do not include this directly.

Function Documentation

◆ As()

template<class Type >
const T & As ( )
inline

Dynamically casts and dereferences to the type presented as a template parameter, or throws ErrorMsgCast if it fails.

Const version of operator*()

Dereference as the default type.

See also
operator()

◆ Cast()

template<class Type >
Ptr<Type> Cast ( )
inline

Dynamically casts to an RC::Ptr of the type used as a template parameter on this function.

The Ptr is NULL if the cast fails.

◆ IsNull()

bool IsNull ( ) const
inline

True if the pointer is NULL.

Returns
True if the pointer is NULL.

◆ IsSet()

bool IsSet ( ) const
inline

True if the pointer is non-NULL.

Returns
True if the pointer is non-NULL.

◆ operator*()

const T & operator* ( )
inline

Dereferences the pointer, or throws an exception if null.

Const version of operator*()

The exception thrown is RC::ErrorMsgNull.

Returns
A reference to the dereferenced object.

◆ operator->()

const T * operator-> ( )
inline

Provides access to the enclosed pointer, or throws RC::ErrorMsgNull if null.

Const version of operator->()

Returns
The enclosed pointer.
email address
— (c) 2015