#include "TypeAwareObject.h"#include <string>Go to the source code of this file.
Classes | |
| class | Subject |
| Base class for objects to send notification when their data changes. More... | |
Defines | |
| #define | SIGNAL_METHOD(type, name) |
| #define | SIGNAL_NAME(type, name) type::signal##name() |
| #define SIGNAL_METHOD | ( | type, | |||
| name | ) |
Value:
static const std::string &signal##name() \ { \ static std::string signalName(#type "::" #name); \ return signalName;\ }
This macro will create a static method to use when attaching, detaching and notifying. The full body of the method is created. For example:
SIGNAL_METHOD(MyClass, MySignal)
static const std::string &signalMySignal() { ... }
| type | The class that the signal is emitted by | |
| name | The unique name for the signal. |
| #define SIGNAL_NAME | ( | type, | |||
| name | ) | type::signal##name() |
This macro simplifies specifying a particular signal.
For example:
notify(SIGNAL_NAME(MyClass, MySignal));
SIGNAL_METHOD(MyClass, MySignal)
| type | The class that the signal is emitted by | |
| name | The unique name for the signal. |