PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFXResponderPointer
Smart pointer template for the Responder class.
#include <SFXResponderPointer.h.hpp>
class SFXResponderPointer;
SFMTYPEDEFCLASS(SFXResponderPointer)

Inheritance diagram

 Inheritance diagram of SFXResponderPointerClass

Collaboration diagram

 Collaboration diagram of SFXResponderPointerClass

Description

The SFXResponderPointer class provides functions to automatically manage the reference count regarding the Responder class.

Reference

Responder

Member

Constructor/Destructor
SFXResponderPointer( Void )
Constructor of the SFXResponderPointer class.
SFXResponderPointer( SFXResponderPointer< M > const & param )
Constructor of the SFXResponderPointer class.
SFXResponderPointer( SFXResponderPointer< T > const & param )
Constructor of the SFXResponderPointer class.
SFXResponderPointer( T * pointer , Bool increment = true )
Constructor of the SFXResponderPointer class.
Public Functions
Void Attach( T * pointer )
Delegate the control privilege of the specified instance of the T type to this SFXResponderPointer instance.
T * Detach( Void )
Delegate the control privilege of this SFXResponderPointer instance to the instance of the T type.
static
SFXResponderPointer< T > const &
EmptyInstance( Void )
Get the reference to a SFXResponderPointer instance that is invalid.
T * Get( Void )
Get the pointer to the instance managed by the SFXResponderPointer class.
Void Release( Void )
Release the SFXResponderPointer instance.
Void Set( SFXResponderPointer< M > const & param )
Set the SFXResponderPointer instance.
Void Set( SFXResponderPointer< T > const & param )
Set the SFXResponderPointer instance.
Void Set( T * pointer , Bool increment = true )
Set the SFXResponderPointer instance.
T * operator->( Void )
Call the instance managed by the SFXResponderPointer instance.
SFXResponderPointer< T > & operator=( SFXResponderPointer< M > const & param )
Assign a SFXResponderPointer instance.
SFXResponderPointer< T > & operator=( SFXResponderPointer< T > const & param )
Assign a SFXResponderPointer instance.
Bool operator==( SFXResponderPointer< T > const & left , SFXResponderPointer< M > const & right )
Check the == relation.
Bool operator==( SFXResponderPointer< T > const & left , SFYResponderConstPtr right )
Check the == relation.
Bool operator==( SFYResponderConstPtr left , SFXResponderPointer< T > const & right )
Check the == relation.
Bool operator!=( SFXResponderPointer< T > const & left , SFXResponderPointer< M > const & right )
Check the != relation.
Bool operator!=( SFXResponderPointer< T > const & left , SFYResponderConstPtr right )
Check the != relation.
Bool operator!=( SFYResponderConstPtr left , SFXResponderPointer< T > const & right )
Check the != relation.
Global Functions
SFXResponderPointer< T > const_pointer_cast( SFXResponderPointer< M > const & param )
Perform the const_cast operation between two SFXResponderPointer instances.
SFXResponderPointer< T > dynamic_pointer_cast( SFXResponderPointer< M > const & param )
Perform the dynamic_cast operation between two SFXResponderPointer instances.
SFXResponderPointer< T > reinterpret_pointer_cast( SFXResponderPointer< M > const & param )
Perform the reinterpret_cast operation between two SFXResponderPointer instances.
SFXResponderPointer< T > static_pointer_cast( SFXResponderPointer< M > const & param )
Perform the static_cast operation between two SFXResponderPointer instances.
Bool operator==( SFXResponderPointer< T > const & left , SFXResponderPointer< M > const & right )
Check the == relation.
Bool operator==( SFXResponderPointer< T > const & left , SFYResponderConstPtr right )
Check the == relation.
Bool operator==( SFYResponderConstPtr left , SFXResponderPointer< T > const & right )
Check the == relation.
T & operator*( Void )
Get the instance managed by the SFXResponderPointer instance.
Bool operator!=( SFXResponderPointer< T > const & left , SFXResponderPointer< M > const & right )
Check the != relation.
Bool operator!=( SFXResponderPointer< T > const & left , SFYResponderConstPtr right )
Check the != relation.
Bool operator!=( SFYResponderConstPtr left , SFXResponderPointer< T > const & right )
Check the != relation.

SFXResponderPointer::SFXResponderPointer
Constructor of the SFXResponderPointer class.
[ public, explicit ]
SFXResponderPointer(Void);
[ public ]
SFXResponderPointer(
    SFXResponderPointer< M > const & param   // reference to the SFXResponderPointer instance to copy
);
[ public ]
SFXResponderPointer(
    SFXResponderPointer< T > const & param   // reference to the SFXResponderPointer instance to copy
);
[ public, explicit ]
SFXResponderPointer(
    T * pointer             // pointer to the instance of a T class
    Bool increment = true   // specify whether or not to increase the number of reference counter
);

SFXResponderPointer::Attach
Delegate the control privilege of the specified instance of the T type to this SFXResponderPointer instance.
[ public ]
Void Attach(
    T * pointer   // pointer to the SFXResponderPointer instance
);

Description

When the control privilege of the instance of the T type is delegeted to this SFXResponderPointer instance, the reference count is managed by the SFXResponderPointer instance and it is automatically released after used.

The "SFXResponderPointer::Attach(address);" statement is the same as the "SFXResponderPointer::Set(address, false);" statement.

Reference

SFXResponderPointer::Detach


SFXResponderPointer::Detach
Delegate the control privilege of this SFXResponderPointer instance to the instance of the T type.
[ public ]
T * Detach(Void);

Return value

Return the instance of the T type for this SFXResponderPointer instance.

Description

After executing the SFXResponderPointer::Detach function, the instance of the T type is not managed by the SFXResponderPointer instance. The reference count is also not managed, and therefore this instance needs to be released after used.


SFXResponderPointer::EmptyInstance
Get the reference to a SFXResponderPointer instance that is invalid.
[ public, static ]
SFXResponderPointer< T > const & EmptyInstance(Void);

Return value

Return the reference to a SFXResponderPointer instance that is invalid.

Description

Since a reference to the null cannot be created, the SFXResponderPointer::EmptyInstance function is used to create an invalid instance.


SFXResponderPointer::Get
Get the pointer to the instance managed by the SFXResponderPointer class.
[ public, const ]
T * Get(Void);

Reference

SFXResponderPointer::Set


SFXResponderPointer::Release
Release the SFXResponderPointer instance.
[ public ]
Void Release(Void);

Description

The reference counter managed by the SFXResponderPointer instance is decreased. And the released instance will not be managed.


SFXResponderPointer::Set
Set the SFXResponderPointer instance.
[ public ]
Void Set(
    SFXResponderPointer< M > const & param   // reference to the SFXResponderPointer instance to set
);
[ public ]
Void Set(
    SFXResponderPointer< T > const & param   // reference to the SFXResponderPointer instance to set
);
[ public ]
Void Set(
    T * pointer             // pointer to the instance of a T class
    Bool increment = true   // whether or not to increase the reference counter
);

Description

The SFXResponderPointer instance is set after the reference counter regarding the previous instance is decreased.

Reference

SFXResponderPointer::Get | SFXResponderPointer::operator=


const_pointer_cast
Perform the const_cast operation between two SFXResponderPointer instances.
SFXResponderPointer< T > const_pointer_cast(
    SFXResponderPointer< M > const & param   // pointer to the SFXResponderPointer instance to cast
);

Description

The const_pointer_cast function is used to const_cast a SFXResponderPointer instance to another one.

Reference

static_pointer_cast | dynamic_pointer_cast | reinterpret_pointer_cast


dynamic_pointer_cast
Perform the dynamic_cast operation between two SFXResponderPointer instances.
SFXResponderPointer< T > dynamic_pointer_cast(
    SFXResponderPointer< M > const & param   // pointer to the SFXResponderPointer instance to cast
);

Description

The dynamic_pointer_cast function is used to dynamic_cast a SFXResponderPointer instance to another one.

Reference

static_pointer_cast | const_pointer_cast | reinterpret_pointer_cast


reinterpret_pointer_cast
Perform the reinterpret_cast operation between two SFXResponderPointer instances.
SFXResponderPointer< T > reinterpret_pointer_cast(
    SFXResponderPointer< M > const & param   // pointer to the SFXResponderPointer instance to cast
);

Description

The reinterpret_pointer_cast function is used to reinterpret_cast a SFXResponderPointer instance to another one.

Reference

static_pointer_cast | const_pointer_cast | dynamic_pointer_cast


static_pointer_cast
Perform the static_cast operation between two SFXResponderPointer instances.
SFXResponderPointer< T > static_pointer_cast(
    SFXResponderPointer< M > const & param   // pointer to the SFXResponderPointer instance to cast
);

Description

The static_pointer_cast function is used to static_cast a SFXResponderPointer instance to another one.

Reference

const_pointer_cast | dynamic_pointer_cast | reinterpret_pointer_cast


SFXResponderPointer::operator->
Call the instance managed by the SFXResponderPointer instance.
[ public, const ]
T * operator->(Void);

SFXResponderPointer::operator=
Assign a SFXResponderPointer instance.
[ public ]
SFXResponderPointer< T > & operator=(
    SFXResponderPointer< M > const & param   // reference to the SFXResponderPointer instance to assign
);
[ public ]
SFXResponderPointer< T > & operator=(
    SFXResponderPointer< T > const & param   // reference to the SFXResponderPointer instance to assign
);

Description

The SFXResponderPointer::operator= operator calls the SFXResponderPointer::Set(SFXResponderPointer< M > const &) or SFXResponderPointer::Set(SFXResponderPointer< T > const &) function internally.

Reference

SFXResponderPointer::Set


operator==
Check the == relation.
[ public, friend ]
Bool operator==(
    SFXResponderPointer< T > const & left    // reference to the SFXResponderPointer instance to be compared
    SFXResponderPointer< M > const & right   // reference to the SFXResponderPointer instance to compare with
);
[ public, friend ]
Bool operator==(
    SFXResponderPointer< T > const & left   // reference to the SFXResponderPointer instance to be compared
    SFYResponderConstPtr right              // pointer to the SFYResponder instance to compare with
);
[ public, friend ]
Bool operator==(
    SFYResponderConstPtr left                // pointer to the SFYResponder instance to be compared
    SFXResponderPointer< T > const & right   // reference to the SFXResponderPointer instance to compare with
);

Return value

  • If equal: true
  • Otherwise: false

operator*
Get the instance managed by the SFXResponderPointer instance.
[ const ]
T & operator*(Void);

operator!=
Check the != relation.
[ public, friend ]
Bool operator!=(
    SFXResponderPointer< T > const & left    // reference to the SFXResponderPointer instance to be compared
    SFXResponderPointer< M > const & right   // reference to the SFXResponderPointer instance to compare with
);
[ public, friend ]
Bool operator!=(
    SFXResponderPointer< T > const & left   // reference to the SFXResponderPointer instance to be compared
    SFYResponderConstPtr right              // pointer to the SFYResponder instance to compare with
);
[ public, friend ]
Bool operator!=(
    SFYResponderConstPtr left                // pointer to the SFYResponder instance to be compared
    SFXResponderPointer< T > const & right   // reference to the SFXResponderPointer instance to compare with
);

Return value

  • If not equal: true
  • Otherwise: false