Go to the source code of this file.
This header provides macros that allows a signal to be emitted from a derived class of its owner.
In 'protected' section of owner class declaration, DECLARE_SIGNAL_EMIT(signalName) From a derived class of owner, this->emitSignal(signalName, arg1, arg2);
Definition in file emit.hpp.
◆ DECLARE_SIGNAL_EMIT
#define DECLARE_SIGNAL_EMIT |
( |
|
signalName | ) |
|
Value: template<typename ...TArgs> \
void emit_##signalName(const TArgs&... args) \
{ \
signalName(args...); \
}
(implementation detail) declares a 'emit_signalName' method
- Note
- This macro should be used in 'protected' section so that it's accessible by derived classes.
-
emit_signalName method is implementation detail. Derived classes should use 'emitSignal' macro.
-
The name 'emit_signalName' is an intentional violation of code-style rule 2.5.
-
The method is declared as a template, so that the macro doesn't need argument types. But only argument types that are compatible with Signal declaration will work.
Definition at line 60 of file emit.hpp.
◆ NDN_CXX_SIGNAL_EMIT
#define NDN_CXX_SIGNAL_EMIT |
( |
|
signalName, |
|
|
|
... |
|
) |
| emit_##signalName(__VA_ARGS__) |
(implementation detail) invokes emit_signalName method
- Note
- C99 requires at least one argument to be passed in VA_ARGS, thus a DummyExtraArg is expected at the end of VA_ARGS, which will be accepted but ignored by Signal::operator() overload.
Definition at line 72 of file emit.hpp.
◆ emitSignal
(implementation detail)
Definition at line 77 of file emit.hpp.