X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FEvents%2FEvents_Listener.cpp;h=158446b12f382453ac68875a9e49cfeee8e5a6dc;hb=176403004ff97696f3c0b5f8bdf48692177fb34a;hp=1d55bb95562afb7675792cbe9597d928d0cf6362;hpb=f1cd93fd02a54259f72e3191d037323a496b2bef;p=modules%2Fshaper.git diff --git a/src/Events/Events_Listener.cpp b/src/Events/Events_Listener.cpp index 1d55bb955..158446b12 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); + } +}