#include <MemberFunction.h>
|
| | MemberFunction ()=delete |
| | MemberFunction (std::function< returnType(parameter...)> function, std::string nameOfFunction, GameObject *funcOwner) |
| | Creates a MemberFunction from a given std::function, a name, and an owner
NOTE: The std::function return type and parameters should match that of the Member Function
NOTE: The std::function should be bound (std::bind_front) to the object instance before being passed in
Example Call:
std::function<void(const Message&)> functionToCall = std::bind_front(functionToLink, pointerToSelf);
th::MemberFunction<void, const Message&> connectedFunction{functionToCall, functionName, pointerToSelf};.
|
| auto | operator== (const MemberFunction &rhs) const -> bool |
| auto | operator() (parameter... inputParameter) -> returnType |
| | Call the function associated with a Member Function.
|
| auto | hasValidOwner () const -> bool |
| | Checks if the owner of the member function still exists.
|
| auto | function_owner () const -> GameObject * |
| auto | function_name () const -> const std::string & |
◆ MemberFunction() [1/2]
template<typename returnType, typename... parameter>
◆ MemberFunction() [2/2]
template<typename returnType, typename... parameter>
| th::MemberFunction< returnType, parameter >::MemberFunction |
( |
std::function< returnType(parameter...)> | function, |
|
|
std::string | nameOfFunction, |
|
|
GameObject * | funcOwner ) |
|
inline |
Creates a MemberFunction from a given std::function, a name, and an owner
NOTE: The std::function return type and parameters should match that of the Member Function
NOTE: The std::function should be bound (std::bind_front) to the object instance before being passed in
Example Call:
std::function<void(const Message&)> functionToCall = std::bind_front(functionToLink, pointerToSelf);
th::MemberFunction<void, const Message&> connectedFunction{functionToCall, functionName, pointerToSelf};.
- Parameters
-
| function | The actual function that you want to be called |
| nameOfFunction | The name of the function. Should always match the actual name in the class |
| funcOwner | The object that the function belongs to |
◆ function_name()
template<typename returnType, typename... parameter>
| auto th::MemberFunction< returnType, parameter >::function_name |
( |
| ) |
const->conststd::string & |
|
inlinenodiscard |
◆ function_owner()
template<typename returnType, typename... parameter>
◆ hasValidOwner()
template<typename returnType, typename... parameter>
Checks if the owner of the member function still exists.
- Returns
- TRUE if the owner has not been destroyed, FALSE otherwise
◆ operator()()
template<typename returnType, typename... parameter>
| auto th::MemberFunction< returnType, parameter >::operator() |
( |
parameter... | inputParameter | ) |
->returnType |
|
inline |
Call the function associated with a Member Function.
- Parameters
-
| inputParameter | The parameter to pass into the function |
- Returns
- Whatever the function normally returns
◆ operator==()
template<typename returnType, typename... parameter>
- Parameters
-
| rhs | The Member Function you want to compare against |
- Returns
- TRUE if the other function has the same function name and owner, FALSE otherwise
◆ actualFunction
template<typename returnType, typename... parameter>
| std::function<returnType(parameter...)> th::MemberFunction< returnType, parameter >::actualFunction |
|
private |
◆ functionName
template<typename returnType, typename... parameter>
◆ functionOwner
template<typename returnType, typename... parameter>
The documentation for this class was generated from the following file: