Public Types | |
typedef NMap< nint32, NEventHandlerBase1< Param1 > * > | HandlersMap |
Type definition for the event handlers map. | |
Public Member Functions | |
NEvent1 () | |
Creates a NEvent1 object. | |
virtual | ~NEvent1 () |
Destroys a NEvent1 object. | |
template<typename ListenerT> | |
NEventId | attach (ListenerT *object, void(ListenerT::*member)(Param1)) |
Attaches a handler to the event. | |
bool | detach (NEventId id) |
Detaches a handler from the event. | |
bool | isAttached (NEventId id) |
Checks whether a handler is attached. | |
void | notify (Param1 param) const |
Notify all the attached handlers. |
Definition at line 36 of file nevent1.hpp.
NEventId attach | ( | ListenerT * | object, | |
void(ListenerT::*)(Param1) | member | |||
) | [inline] |
Attaches a handler to the event.
object | Pointer to the object that will react to an event | |
(ListenerT::*member)(Param1) | Member function pointer to be executed on response of a event |
Definition at line 108 of file nevent1.hpp.
References NMap::insert().
bool detach | ( | NEventId | id | ) | [inline] |
Detaches a handler from the event.
id | Handler id |
Definition at line 124 of file nevent1.hpp.
References NMap::end(), NMap::erase(), NMap::find(), and NMap::iterator::value().
Referenced by NSlot1::~NSlot1().
bool isAttached | ( | NEventId | id | ) | [inline] |
Checks whether a handler is attached.
id | Handler id to be checked against the event |
Definition at line 140 of file nevent1.hpp.
References NMap::end(), and NMap::find().
Referenced by NSignal1::~NSignal1().
void notify | ( | Param1 | param | ) | const [inline] |
Notify all the attached handlers.
param | Any given parameter to be passed to the handlers |
Definition at line 145 of file nevent1.hpp.
References NMap::constBegin(), and NMap::constEnd().
Referenced by NSignal1::emit_sig().