Skip to content

iox::cxx::ConstMethodCallback🔗

More...

Public Types🔗

Name
template <typename T >
using ReturnValue(T::*)(Args...) const
ConstMethodPointer

Public Functions🔗

Name
ConstMethodCallback() =default
ConstMethodCallback(const ConstMethodCallback & rhs) =default
ConstMethodCallback & operator=(const ConstMethodCallback & rhs) =default
~ConstMethodCallback() =default
template <typename ClassType >
ConstMethodCallback(const ClassType & objectRef, ConstMethodPointer< ClassType > const methodPtr)
Constructs a ConstMethodCallback from a pointer to a specific object and a pointer to a method of that class.
ConstMethodCallback(ConstMethodCallback && rhs)
Move constructor.
ConstMethodCallback & operator=(ConstMethodCallback && rhs)
Move assignment operator.
template <typename... MethodArguments>
expected< ReturnValue, MethodCallbackError >
operator()(MethodArguments &&... args) const
Calls the method if the ConstMethodCallback is valid, otherwise it will return MethodCallbackError::UNINITIALIZED_CALLBACK.
bool operator==(const ConstMethodCallback & rhs) const
Comparison operator. Two ConstMethodCallbacks are equal if they have the same object pointer and method pointer.
bool operator!=(const ConstMethodCallback & rhs) const
Inequality operator. Two ConstMethodCallback are not equal if they have different object or method pointer.
operator bool() const
Verifies if the ConstMethodCallback is valid.
bool isValid() const
Verifies if the ConstMethodCallback is valid.
template <typename ClassType >
void
setCallback(const ClassType & objectRef, ConstMethodPointer< ClassType > methodPtr)
Sets a new callback.
template <typename ClassType >
const ClassType *
getObjectPointer() const
Returns object pointer.
template <typename ClassType >
auto
getMethodPointer() const
Returns cond method pointer.

Detailed Description🔗

template <typename ReturnValue ,
typename... Args>
class iox::cxx::ConstMethodCallback;

Public Types Documentation🔗

using ConstMethodPointer🔗

template <typename T >
using iox::cxx::ConstMethodCallback< ReturnValue, Args >::ConstMethodPointer =  ReturnValue (T::*)(Args...) const;

Public Functions Documentation🔗

function ConstMethodCallback🔗

ConstMethodCallback() =default

function ConstMethodCallback🔗

ConstMethodCallback(
    const ConstMethodCallback & rhs
) =default

function operator=🔗

ConstMethodCallback & operator=(
    const ConstMethodCallback & rhs
) =default

function ~ConstMethodCallback🔗

~ConstMethodCallback() =default

function ConstMethodCallback🔗

template <typename ClassType >
ConstMethodCallback(
    const ClassType & objectRef,
    ConstMethodPointer< ClassType > const methodPtr
)

Constructs a ConstMethodCallback from a pointer to a specific object and a pointer to a method of that class.

Parameters:

  • objectRef const object reference
  • methodPtr pointer to a const method

function ConstMethodCallback🔗

ConstMethodCallback(
    ConstMethodCallback && rhs
)

Move constructor.

Parameters:

  • rhs move origin

function operator=🔗

ConstMethodCallback & operator=(
    ConstMethodCallback && rhs
)

Move assignment operator.

Parameters:

  • rhs move origin

Return: reference to this

function operator()🔗

template <typename... MethodArguments>
expected< ReturnValue, MethodCallbackError > operator()(
    MethodArguments &&... args
) const

Calls the method if the ConstMethodCallback is valid, otherwise it will return MethodCallbackError::UNINITIALIZED_CALLBACK.

Parameters:

  • args... arguments which will be perfectly forwarded to the method

Return: If ConstMethodCallback is valid the return value of the method, otherwise an error.

function operator==🔗

bool operator==(
    const ConstMethodCallback & rhs
) const

Comparison operator. Two ConstMethodCallbacks are equal if they have the same object pointer and method pointer.

function operator!=🔗

bool operator!=(
    const ConstMethodCallback & rhs
) const

Inequality operator. Two ConstMethodCallback are not equal if they have different object or method pointer.

function operator bool🔗

explicit operator bool() const

Verifies if the ConstMethodCallback is valid.

Return: true if objectRef != nullptr otherwise false

function isValid🔗

bool isValid() const

Verifies if the ConstMethodCallback is valid.

Return: true if objectRef != nullptr otherwise false

function setCallback🔗

template <typename ClassType >
void setCallback(
    const ClassType & objectRef,
    ConstMethodPointer< ClassType > methodPtr
)

Sets a new callback.

Parameters:

  • objectRef const reference to the object
  • methodPtr pointer to the method

function getObjectPointer🔗

template <typename ClassType >
const ClassType * getObjectPointer() const

Returns object pointer.

function getMethodPointer🔗

template <typename ClassType >
auto getMethodPointer() const

Returns cond method pointer.


Updated on 2 April 2022 at 16:37:47 CEST