Home
Base module

ClassDelegate

The ClassDelegate contains a pointer to a class member.

ClassDelegate

#include <icy/delegate.h>
template<class Class, typename RT, typename... Args>
struct ClassDelegate

Defined in src/base/include/icy/delegate.h:79

Inherits: AbstractDelegate< RT, Args... >

The [ClassDelegate](#classdelegate) contains a pointer to a class member.

This class implements fast delegates and function comparison.

List of all members

NameKindOwner
instancevariableDeclared here
methodvariableDeclared here
ClassDelegatefunctionDeclared here
operator()functionDeclared here
operator==functionDeclared here
~AbstractDelegatefunctionInherited from AbstractDelegate
operator()functionInherited from AbstractDelegate
operator==functionInherited from AbstractDelegate

Inherited from AbstractDelegate

KindNameDescription
function~AbstractDelegate virtual inline
functionoperator() virtual constInvokes the underlying callable with the supplied arguments.
functionoperator== virtual constCompares two delegates for equality (same target function and instance).

Public Attributes

ReturnNameDescription
Class *instance
RT(Class::*method

instance

Class * instance

Defined in src/base/include/icy/delegate.h:81


method

RT(Class::* method

Defined in src/base/include/icy/delegate.h:82

Public Methods

ReturnNameDescription
ClassDelegate inline
RToperator() virtual const inline overrideCalls the member function on instance.
booloperator== virtual const inline override

ClassDelegate

inline

inline ClassDelegate(Class * instance, RT(Class::*)(Args...) method)

Defined in src/base/include/icy/delegate.h:86

Parameters

  • instance Object on which to invoke the member function.

  • method Pointer to the member function to wrap.


operator()

virtual const inline override

virtual inline RT operator()(Args... args) const override

Defined in src/base/include/icy/delegate.h:95

Calls the member function on instance.

Parameters

  • args Arguments forwarded to the method.

Returns

Method result.

Reimplements

operator==

virtual const inline override

virtual inline bool operator==(const AbstractDelegate< RT, Args... > & that) const override

Defined in src/base/include/icy/delegate.h:102

Parameters

  • that Other delegate to compare.

Returns

True if both delegates wrap the same instance/method pair.

Reimplements