24 namespace learningmachine {
47 EventDispatcher::~EventDispatcher() {
52 assert(
idx >= 0 &&
idx <
int(this->listeners.size()));
53 std::list<IEventListener*>::iterator it = this->listeners.begin();
54 std::advance(it,
idx);
56 this->listeners.erase(it);
60 this->listeners.remove(listener);
65 std::list<IEventListener*>::iterator it = this->listeners.begin();
66 std::advance(it,
idx);
71 std::list<IEventListener*>::const_iterator it = this->listeners.begin();
72 std::advance(it,
idx);
84 std::list<IEventListener*>::iterator it;
85 for(it = listeners.begin(); it != listeners.end(); it++) {
86 if((*it)->isEnabled()) {
virtual bool hasListeners()
Tells whether there are listeners for events.
virtual void clear()
Clears all the IEventListeners from the EventDispatcher.
virtual void raise(IEvent &event)
Raises an IEvent, causing it to be dispatched to each registered IEventListener.
virtual IEventListener & getAt(int idx)
Returns the IEventListener at a specified index.
virtual void removeListener(int idx)
Removes an IEventListener from the list.
static uint32_t idx[BOARD_NUM]
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.