iox::cxx::ConstMethodCallback🔗
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. |
template \<typename ClassType > |
ConstMethodCallback(const ClassType & objectRef, ReturnValue(ClassType::*)(Args...) const methodPtr) |
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🔗
inline ConstMethodCallback(
ConstMethodCallback && rhs
)
Move constructor.
Parameters:
- rhs move origin
function operator=🔗
inline ConstMethodCallback & operator=(
ConstMethodCallback && rhs
)
Move assignment operator.
Parameters:
- rhs move origin
Return: reference to this
function operator()🔗
template <typename... MethodArguments>
inline 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==🔗
inline bool operator==(
const ConstMethodCallback & rhs
) const
Comparison operator. Two ConstMethodCallbacks are equal if they have the same object pointer and method pointer.
function operator!=🔗
inline bool operator!=(
const ConstMethodCallback & rhs
) const
Inequality operator. Two ConstMethodCallback are not equal if they have different object or method pointer.
function operator bool🔗
inline explicit operator bool() const
Verifies if the ConstMethodCallback is valid.
Return: true if objectRef != nullptr otherwise false
function isValid🔗
inline bool isValid() const
Verifies if the ConstMethodCallback is valid.
Return: true if objectRef != nullptr otherwise false
function setCallback🔗
template <typename ClassType >
inline 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 >
inline const ClassType * getObjectPointer() const
Returns object pointer.
function getMethodPointer🔗
template <typename ClassType >
inline auto getMethodPointer() const
Returns cond method pointer.
function ConstMethodCallback🔗
template <typename ClassType >
inline ConstMethodCallback(
const ClassType & objectRef,
ReturnValue(ClassType::*)(Args...) const methodPtr
)
Updated on 31 May 2022 at 15:29:15 CEST