X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FEvents%2FEvents_Listener.cpp;h=e29f3c178875645bbcd90b18242c05bbc566a5d5;hb=5c13fa0e68725babdd09541b028c186896e27b4f;hp=1d55bb95562afb7675792cbe9597d928d0cf6362;hpb=3874b57fe5aba25ff5aee2a07654fc23c1ee8eb0;p=modules%2Fshaper.git diff --git a/src/Events/Events_Listener.cpp b/src/Events/Events_Listener.cpp index 1d55bb955..e29f3c178 100644 --- a/src/Events/Events_Listener.cpp +++ b/src/Events/Events_Listener.cpp @@ -5,3 +5,33 @@ // Author: Mikhail PONIKAROV #include +#include +#include + +void Events_Listener::groupWhileFlush(const std::shared_ptr& theMessage) { + std::shared_ptr aGroup = + std::dynamic_pointer_cast(theMessage); + if (aGroup) { + std::map >::iterator aMyGroup = myGroups.find( + aGroup->eventID().eventText()); + if (aMyGroup == myGroups.end()) { // create a new group of messages for accumulation + myGroups[aGroup->eventID().eventText()] = aGroup->newEmpty(); + aMyGroup = myGroups.find(aGroup->eventID().eventText()); + } + std::shared_ptr aStored = + std::dynamic_pointer_cast(aMyGroup->second); + aStored->Join(aGroup); + //std::cout<<"Add to group "<eventID().eventText()< >::iterator aMyGroup = + myGroups.find(theID.eventText()); + if (aMyGroup != myGroups.end()) { + std::shared_ptr aMessage = aMyGroup->second; + myGroups.erase(aMyGroup); + processEvent(aMessage); + } +}