System::WeakReference Class Reference

Represents a weak reference, which references an object while still allowing that object to be deleted. More...

Public Member Functions

 WeakReference ()
 Default constructor. More...
 
 WeakReference (const SmartPtr< Object > &data)
 Initializes a new instance of the WeakReference class, referencing the specified object. More...
 
const SmartPtr< Object > & get_Target () const
 Gets the object (the target) referenced by the current WeakReference object. More...
 
void set_Target (const SmartPtr< Object > &data)
 Sets the object (the target) referenced by the current WeakReference object. More...
 
bool get_IsAlive () const
 Gets an indication whether the object referenced by the current WeakReference object has been deleted. More...
 
void reset ()
 
bool operator== (std::nullptr_t) const
 Checks if referenced object is null. More...
 
bool operator!= (std::nullptr_t) const
 Checks if referenced object is not null. More...
 
bool operator== (const WeakReference &other) const
 Compares referenced object to another instance WeakReference class. More...
 
bool operator!= (const WeakReference &other) const
 Compares referenced object to another instance WeakReference class. More...
 

Detailed Description

Represents a weak reference, which references an object while still allowing that object to be deleted.

Constructor & Destructor Documentation

◆ WeakReference() [1/2]

System::WeakReference::WeakReference ( )
inline

Default constructor.

◆ WeakReference() [2/2]

System::WeakReference::WeakReference ( const SmartPtr< Object > &  data)
inline

Initializes a new instance of the WeakReference class, referencing the specified object.

Member Function Documentation

◆ get_IsAlive()

bool System::WeakReference::get_IsAlive ( ) const
inline

Gets an indication whether the object referenced by the current WeakReference object has been deleted.

◆ get_Target()

const SmartPtr<Object>& System::WeakReference::get_Target ( ) const
inline

Gets the object (the target) referenced by the current WeakReference object.

◆ operator!=() [1/2]

bool System::WeakReference::operator!= ( const WeakReference other) const
inline

Compares referenced object to another instance WeakReference class.

Parameters
otherObject compare to.
Returns
True if compared objects reference different objects, false if objects are same.

◆ operator!=() [2/2]

bool System::WeakReference::operator!= ( std::nullptr_t  ) const
inline

Checks if referenced object is not null.

Returns
True if referenced object is not null, false otherwise.

◆ operator==() [1/2]

bool System::WeakReference::operator== ( const WeakReference other) const
inline

Compares referenced object to another instance WeakReference class.

Parameters
otherObject compare to.
Returns
True if compared objects reference the same object, false otherwise.

◆ operator==() [2/2]

bool System::WeakReference::operator== ( std::nullptr_t  ) const
inline

Checks if referenced object is null.

Returns
True if referenced object is null, false otherwise.

◆ reset()

void System::WeakReference::reset ( )
inline

◆ set_Target()

void System::WeakReference::set_Target ( const SmartPtr< Object > &  data)
inline

Sets the object (the target) referenced by the current WeakReference object.