PolymorphicDelegate
PolymorphicDelegate
#include <icy/delegate.h>template<class Class, typename RT, class PT, class IT>
struct PolymorphicDelegateDefined in src/base/include/icy/delegate.h:154
Inherits:
AbstractDelegate< RT, IT & >
Polymorphic function delegate.
Theis class contains a pointer to a class member that receices a derived subclass (PT) of the base type specified by the IT param.
List of all members
| Name | Kind | Owner |
|---|---|---|
instance | variable | Declared here |
method | variable | Declared here |
PolymorphicDelegate | function | Declared here |
operator() | function | Declared here |
operator== | function | Declared here |
~AbstractDelegate | function | Inherited from AbstractDelegate |
operator() | function | Inherited from AbstractDelegate |
operator== | function | Inherited from AbstractDelegate |
Inherited from AbstractDelegate
| Kind | Name | Description |
|---|---|---|
function | ~AbstractDelegate virtual inline | |
function | operator() virtual const | Invokes the underlying callable with the supplied arguments. |
function | operator== virtual const | Compares two delegates for equality (same target function and instance). |
Public Attributes
instance
Class * instanceDefined in src/base/include/icy/delegate.h:156
method
RT(Class::* methodDefined in src/base/include/icy/delegate.h:157
Public Methods
| Return | Name | Description |
|---|---|---|
PolymorphicDelegate inline | ||
RT | operator() virtual const inline override | Attempts to cast object to PT; invokes the method if successful. Returns a default-constructed RT if the cast fails (packet type mismatch). |
bool | operator== virtual const inline override |
PolymorphicDelegate
inline
inline PolymorphicDelegate(Class * instance, RT(Class::*)(PT &) method)Defined in src/base/include/icy/delegate.h:161
Parameters
instanceObject on which to invoke the member function.methodPointer to the member function accepting a derivedPT&.
operator()
virtual const inline override
virtual inline RT operator()(IT & object) const overrideDefined in src/base/include/icy/delegate.h:171
Attempts to cast object to PT; invokes the method if successful. Returns a default-constructed RT if the cast fails (packet type mismatch).
Parameters
objectBase-type reference; cast toPTbefore dispatch.
Returns
Method result, or default RT on cast failure.
operator==
virtual const inline override
virtual inline bool operator==(const AbstractDelegate< RT, IT & > & that) const overrideDefined in src/base/include/icy/delegate.h:181
Parameters
thatOther delegate to compare.
Returns
True if both delegates wrap the same instance/method pair.
