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

Inheritance diagram

 Inheritance diagram of SFXBrewPointerClass

Collaboration diagram

 Collaboration diagram of SFXBrewPointerClass

Description

The SFXBrewPointer class provides functions to automatically manage the reference count regarding the wrapper class for the BREW interface.

Reference

BREW wrapper class

Member

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

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

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

Description

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

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

Reference

SFXBrewPointer::Set | SFXBrewPointer::Detach


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

Return value

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

Description

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


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

Return value

Return the reference to a SFXBrewPointer instance that is invalid.

Description

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


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

Reference

SFXBrewPointer::Set


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

Description

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


SFXBrewPointer::Set
Set the SFXBrewPointer instance.
[ public ]
Void Set(
    SFXBrewPointer< M > const & param   // reference to the SFXBrewPointer instance
);
[ public ]
Void Set(
    SFXBrewPointer< T > const & param   // reference to the SFXBrewPointer instance
);
[ 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 SFXBrewPointer instance is set after the reference counter regarding the previous instance is decreased.

Reference

SFXBrewPointer::Get | SFXBrewPointer::operator=


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

Description

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

Reference

static_pointer_cast | dynamic_pointer_cast | reinterpret_pointer_cast


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

Description

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

Reference

static_pointer_cast | const_pointer_cast | reinterpret_pointer_cast


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

Description

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

Reference

static_pointer_cast | const_pointer_cast | dynamic_pointer_cast


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

Description

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

Reference

const_pointer_cast | dynamic_pointer_cast | reinterpret_pointer_cast


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

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

Description

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

Reference

SFXBrewPointer::Set


operator==
Check the "==" relation.
[ public, friend ]
Bool operator==(
    SFXBrewPointer< T > const & left    // reference to the SFXBrewPointer instance
    SFXBrewPointer< M > const & right   // reference to the SFXBrewPointer instance
);
[ public, friend ]
Bool operator==(
    SFXBrewPointer< T > const & left   // reference to the SFXBrewPointer instance
    SFBBaseConstPtr right              // pointer to the SFBBase instance
);
[ public, friend ]
Bool operator==(
    SFBBaseConstPtr left                // pointer to the SFBBase instance
    SFXBrewPointer< T > const & right   // reference to the SFXBrewPointer instance
);

Return value

  • If equal: true
  • Otherwise: false

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

operator!=
Check the "!=" relation.
[ public, friend ]
Bool operator!=(
    SFXBrewPointer< T > const & left    // reference to the SFXBrewPointer instance
    SFXBrewPointer< M > const & right   // reference to the SFXBrewPointer instance
);
[ public, friend ]
Bool operator!=(
    SFXBrewPointer< T > const & left   // reference to the SFXBrewPointer instance
    SFBBaseConstPtr right              // pointer to the SFBBase instance
);
[ public, friend ]
Bool operator!=(
    SFBBaseConstPtr left                // pointer to the SFBBase instance
    SFXBrewPointer< T > const & right   // reference to the SFXBrewPointer instance
);

Return value

  • If not equal: true
  • Otherwise: false