X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FEvents%2FEvents_Loop.cpp;h=139e862340007e89ce5dec7723768cb401df18cd;hb=c65c7a084cf32f54c8d8a93fceace414c3b0fb21;hp=d70b9764f1b05603e600cba3d751953e0df5afec;hpb=799e62630fa38d7392a3b6402fa0f8b3831fe52d;p=modules%2Fshaper.git diff --git a/src/Events/Events_Loop.cpp b/src/Events/Events_Loop.cpp index d70b9764f..139e86234 100644 --- a/src/Events/Events_Loop.cpp +++ b/src/Events/Events_Loop.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: Events_Loop.hxx // Created: Thu Mar 13 2014 // Author: Mikhail PONIKAROV @@ -115,17 +117,19 @@ void Events_Loop::flush(const Events_ID& theID) { if (!myFlushActive) return; - std::map>::iterator aMyGroup = - myGroups.find(theID.eventText()); - if (aMyGroup != myGroups.end()) { // really sends - myFlushed.insert(theID.myID); + std::map >::iterator aMyGroup; + for(aMyGroup = myGroups.find(theID.eventText()); + aMyGroup != myGroups.end(); aMyGroup = myGroups.find(theID.eventText())) + { // really sends + bool aWasFlushed = myFlushed.find(theID.myID) != myFlushed.end(); + if (!aWasFlushed) + myFlushed.insert(theID.myID); std::shared_ptr aGroup = aMyGroup->second; myGroups.erase(aMyGroup); send(aGroup, false); - std::set::iterator anIt = myFlushed.find(theID.myID); - if (anIt != myFlushed.end()) { - myFlushed.erase(anIt); - } + + if (!aWasFlushed) + myFlushed.erase(myFlushed.find(theID.myID)); } } @@ -150,3 +154,16 @@ void Events_Loop::autoFlush(const Events_ID& theID, const bool theAuto) else myFlushed.erase(myFlushed.find(theID.myID)); } + +bool Events_Loop::isFlushed(const Events_ID& theID) +{ + return myFlushed.find(theID.myID) != myFlushed.end(); +} + +void Events_Loop::setFlushed(const Events_ID& theID, const bool theValue) +{ + if (theValue) + myFlushed.insert(theID.myID); + else + myFlushed.erase(myFlushed.find(theID.myID)); +}