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 (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...
 
void reset () const
 Sets refereced pointer to null. 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...
 
void mapTo (SmartPtr< Object > &ptr) const
 Make ptr point to the same object referenced smart pointer does. 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 ( 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

◆ 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.

◆ mapTo()

void System::SmartPtrInfo::mapTo ( SmartPtr< Object > &  ptr) const
inline

Make ptr point to the same object referenced smart pointer does.

Implementation.

Parameters
ptrTarget 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..

◆ reset()

void System::SmartPtrInfo::reset ( ) const
inline

Sets refereced pointer to null.