32 UERROR(
"Handler is null!");
45 UERROR(
"Handler is null!");
70 const std::string & eventName)
72 if(!sender || !receiver)
74 UERROR(
"Sender and/or receiver is null!");
86 const std::string & eventName)
88 if(!sender || !receiver)
90 UERROR(
"Sender and/or receiver is null!");
103 UERROR(
"Sender is null!");
116 UERROR(
"Sender is null!");
145 for(std::list<std::pair<UEvent*, const UEventsSender*> >::
iterator it=
events_.begin(); it!=
events_.end(); ++it)
177 std::list<std::pair<UEvent*, const UEventsSender*> >
::iterator it;
178 std::list<std::pair<UEvent*, const UEventsSender*> > eventsBuf;
191 for(it=eventsBuf.begin(); it!=eventsBuf.end(); ++it)
203 std::list<UEventsHandler*> handlers;
212 if(handlers.size() == 0)
218 bool handled =
false;
220 for(std::list<UEventsHandler*>::iterator it=handlers.begin(); it!=handlers.end() && !handled; ++it)
231 if(handler != sender)
252 bool handlerFound =
false;
253 for(std::list<UEventsHandler*>::iterator it=
handlers_.begin(); it!=
handlers_.end(); ++it)
275 for (std::list<UEventsHandler*>::iterator it =
handlers_.begin(); it!=
handlers_.end(); ++it)
290 if(
iter->receiver_ == handler)
308 events_.push_back(std::make_pair(event, sender));
331 const std::string & eventName)
333 std::list<UEventsHandler*> pipes;
338 if(
iter->sender_ == sender &&
iter->eventName_.compare(eventName) == 0)
344 for(std::list<UEventsHandler*>::iterator jter=
handlers_.begin(); jter!=
handlers_.end(); ++jter)
346 if(*jter ==
iter->receiver_)
348 pipes.push_back(*jter);
370 const std::string & eventName)
376 if(
iter->sender_ == sender &&
iter->receiver_ == receiver &&
iter->eventName_.compare(eventName) == 0)
385 bool handlerFound =
false;
389 if(*
iter == receiver)
398 pipes_.push_back(
Pipe(sender, receiver, eventName));
402 UERROR(
"Cannot create the pipe because the receiver is not yet "
403 "added to UEventsManager's handlers list.");
408 UWARN(
"Pipe between sender %p and receiver %p with event %s was already created.",
409 sender, receiver, eventName.c_str());
417 const std::string & eventName)
421 bool removed =
false;
424 if(
iter->sender_ == sender &&
iter->receiver_ == receiver &&
iter->eventName_.compare(eventName) == 0)
437 UWARN(
"Pipe between sender %p and receiver %p with event %s didn't exist.",
438 sender, receiver, eventName.c_str());
449 if(
iter->sender_ == sender)
466 if(
iter->receiver_ == 0)