PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFXRefObjectPointer
Smart pointer template for the reference counting object class.
#include <SFXRefObjectPointer.h.hpp>
class SFXRefObjectPointer;
SFMTYPEDEFCLASS(SFXRefObjectPointer)
        

Inheritance diagram

 Inheritance diagram of SFXRefObjectPointerClass

Collaboration diagram

 Collaboration diagram of SFXRefObjectPointerClass

Description

The SFXRefObjectPointer class provides functions to automatically manage the reference count regarding the reference counting object class.

Reference

SFORefObject

Member

Constructor/Destructor
SFXRefObjectPointer( Void )
Constructor of the SFXRefObjectPointer class.
SFXRefObjectPointer( SFXRefObjectPointer< M > const & param )
Constructor of the SFXRefObjectPointer class.
SFXRefObjectPointer( SFXRefObjectPointer< T > const & param )
Constructor of the SFXRefObjectPointer class.
SFXRefObjectPointer( T * pointer , Bool retain = true )
Constructor of the SFXRefObjectPointer class.
Public Functions
Void Attach( T * pointer )
Delegate the control privilege of the specified instance of the T type to this SFXRefObjectPointer instance.
T * Detach( Void )
Delegate the control privilege of this SFXRefObjectPointer instance to the instance of the T type.
static
SFXRefObjectPointer< T > const &
EmptyInstance( Void )
Get the reference to a SFXRefObjectPointer instance that is invalid.
T * Get( Void )
Get the pointer to the instance managed by the SFXRefObjectPointer class.
Void Release( Void )
Release the SFXRefObjectPointer instance.
Void Set( SFXRefObjectPointer< M > const & param )
Set the SFXRefObjectPointer instance.
Void Set( SFXRefObjectPointer< T > const & param )
Set the SFXRefObjectPointer instance.
Void Set( T * pointer , Bool retain = true )
Set the SFXRefObjectPointer instance.
Bool operator!=( SFXRefObjectPointer< T > const & left , SFXRefObjectPointer< M > const & right )
Check the != relation.
Bool operator!=( SFXRefObjectPointer< T > const & left , SFORefObjectConstPtr right )
Check the != relation.
Bool operator!=( SFORefObjectConstPtr left , SFXRefObjectPointer< T > const & right )
Check the != relation.
T & operator*( Void )
Get the instance managed by the SFXRefObjectPointer instance.
T * operator->( Void )
Call the instance managed by the SFXRefObjectPointer instance.
SFXRefObjectPointer< T > & operator=( SFXRefObjectPointer< M > const & param )
Assign a SFXResponderPointer instance.
SFXRefObjectPointer< T > & operator=( SFXRefObjectPointer< T > const & param )
Assign a SFXResponderPointer instance.
Bool operator==( SFXRefObjectPointer< T > const & left , SFXRefObjectPointer< M > const & right )
Check the == relation.
Bool operator==( SFXRefObjectPointer< T > const & left , SFORefObjectConstPtr right )
Check the == relation.
Bool operator==( SFXRefObjectConstPtr left , SFXRefObjectPointer< T > const & right )
Check the == relation.

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

Reference

SFXRefObjectPointer::Set


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

Description

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

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

Reference

SFXRefObjectPointer::Detach


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

Return value

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

Description

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

Reference

SFXRefObjectPointer::Attach


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

Return value

Return the reference to a SFXRefObjectPointer instance that is invalid.

Description

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


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

Reference

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

Description

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

Reference

SFXRefObjectPointer::Set


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

Description

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

Reference

SFXRefObjectPointer::Get | SFXRefObjectPointer::SFXRefObjectPointer | SFXRefObjectPointer::operator=


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

Description

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

Reference

SFXRefObjectPointer::static_pointer_cast | SFXRefObjectPointer::reinterpret_pointer_cast | SFXRefObjectPointer


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

Description

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

Reference

SFXRefObjectPointer::static_pointer_cast | SFXRefObjectPointer::const_pointer_cast | SFXRefObjectPointer


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

Description

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

Reference

SFXRefObjectPointer::const_pointer_cast | SFXRefObjectPointer::reinterpret_pointer_cast | SFXRefObjectPointer


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

Reference

SFXRefObjectPointer::operator* | SFXRefObjectPointer::Get


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

Description

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

Reference

SFXRefObjectPointer::Set


SFXRefObjectPointer::operator==
Check the == relation.
[ public, friend ]
Bool operator==(
    SFXRefObjectPointer< T > const & left    // const reference to the SFXRefObjectPointer instance to be compared
    SFXRefObjectPointer< M > const & right   // const reference to the SFXRefObject instance to compare with
);
[ public, friend ]
Bool operator==(
    SFXRefObjectPointer< T > const & left   // const reference to the SFXRefObjectPointer  instance to be compared
    SFORefObjectConstPtr right              // const pointer to the SFORefObject instance to compare with
);
[ public, friend ]
Bool operator==(
    SFXRefObjectConstPtr left                // const pointer to the SFORefObject instance to be compared
    SFXRefObjectPointer< T > const & right   // const reference to the SFXRefObjectPointer  instance to compare with
);

Return value

  • If equal: true
  • Otherwise: false

Reference

SFXRefObjectPointer::operator!=


SFXRefObjectPointer::operator*
Get the instance managed by the SFXRefObjectPointer instance.
[ public, const ]
T & operator*(Void);

Reference

SFXRefObjectPointer::operator->


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

Return value

  • If not equal: true
  • Otherwise: false

Reference

SFXRefObjectPointer::operator==