System::SmartPtrInfo Class Reference

Service class to test and alter SmartPtr's contents without knowing final type. Used for garbage collection and loop references detection, etc. Think of it as of 'pointer to pointer'. We can't use SmartPtr's basetype as it doesn't have any; instead, we use this 'info' class. More...

Public Member Functions

 SmartPtrInfo ()
 Creates empty SmartPtrInfo object. More...
 
template<typename T >
 SmartPtrInfo (const SmartPtr< T > &ptr)
 Creates SmartPtrInfo object with information on specific smart pointer. More...
 
 operator bool () const
 Checks if info object points to non-null pointer. More...
 
bool operator! () const
 Checks if info object does not point to non-null pointer. More...
 
Objectoperator-> () const
 Allows to call methods of Object pointed by the referenced pointer. More...
 
bool operator< (const SmartPtrInfo &other) const
 Less-compares values of pointers referenced by two info objects. More...
 
ObjectgetObject () const
 Gets object referenced pointer points to. More...
 
ObjectgetOwned () const
 Gets object owned pointer. More...
 
const void * getInternalPtr () const
 Gets raw object referenced pointer points to. More...
 

Detailed Description

Service class to test and alter SmartPtr's contents without knowing final type. Used for garbage collection and loop references detection, etc. Think of it as of 'pointer to pointer'. We can't use SmartPtr's basetype as it doesn't have any; instead, we use this 'info' class.

Constructor & Destructor Documentation

◆ SmartPtrInfo() [1/2]

System::SmartPtrInfo::SmartPtrInfo ( )
inline

Creates empty SmartPtrInfo object.

◆ SmartPtrInfo() [2/2]

template<typename T >
System::SmartPtrInfo::SmartPtrInfo ( const SmartPtr< T > &  ptr)
inlineexplicit

Creates SmartPtrInfo object with information on specific smart pointer.

Template Parameters
TPointee type.
Parameters
ptrSmart pointer to create info for.

Member Function Documentation

◆ getInternalPtr()

const void* System::SmartPtrInfo::getInternalPtr ( ) const
inline

Gets raw object referenced pointer points to.

Returns
Raw pointer to object referenced smart pointer points to.

◆ getObject()

Object* System::SmartPtrInfo::getObject ( ) const
inline

Gets object referenced pointer points to.

Returns
Raw pointer to object referenced smart pointer points to.

◆ getOwned()

Object* System::SmartPtrInfo::getOwned ( ) const
inline

Gets object owned pointer.

Returns
Raw pointer to object owned smart pointer.

◆ operator bool()

System::SmartPtrInfo::operator bool ( ) const
inline

Checks if info object points to non-null pointer.

Returns
True if info object points to the pointer and this pointer is not null, false otherwise.

◆ operator!()

bool System::SmartPtrInfo::operator! ( ) const
inline

Checks if info object does not point to non-null pointer.

Returns
False if info object doesn't point to any pointer or if referenced pointer is null, true otherwise.

◆ operator->()

Object* System::SmartPtrInfo::operator-> ( ) const
inline

Allows to call methods of Object pointed by the referenced pointer.

Returns
Poinee object of referenced pointer.

◆ operator<()

bool System::SmartPtrInfo::operator< ( const SmartPtrInfo other) const
inline

Less-compares values of pointers referenced by two info objects.

Parameters
otherInformation on pointer to compare with.
Returns
True if value of pointer referenced by current info object preceeds the value of other one, false otherwise..