Salome HOME
Debug of flush operation
[modules/shaper.git] / src / Events / Events_Loop.h
index 893ecb1994de3a38eb47581ffd950b128ff32c0b..d19dd4d4a39cee1fa832018961e49ea5b8702309 100644 (file)
@@ -11,6 +11,8 @@
 #include <map>
 #include <list>
 
+class Events_MessageGroup;
+
 /**\class Events_Lopp
  * \ingroup EventsLoop
  * \brief Base class that manages the receiving and sending of all
  * control back immideately.
  */
 class Events_Loop {
+  /// map from event ID to sender pointer to listeners that must be called for this
   std::map<char*, std::map<void*, std::list<Events_Listener*> > >
-    myListeners; ///< map from event ID to sender pointer to listeners that must be called for this
+    myListeners;
+
+  /// map from event ID to groupped messages (accumulated on flush)
+  std::map<char*, Events_MessageGroup*> myGroups;
 
   //! The empty constructor, will be called at startup of the application, only once
   Events_Loop() {};
@@ -35,12 +41,16 @@ public:
   EVENTS_EXPORT static Events_ID eventByName(const char* theName);
 
   //! Allows to send an event
-  EVENTS_EXPORT void send(Events_Message& theMessage);
+  //! \param isGroup is true for grouping messages if possible
+  EVENTS_EXPORT void send(Events_Message& theMessage, bool isGroup = true);
 
   //! Registers (or adds if such listener is already registered) a listener 
   //! that will be called on the event and from the defined sender
   EVENTS_EXPORT void registerListener(Events_Listener* theListener, const Events_ID theID, 
     void* theSender = 0);
+
+  //! Initializes sending of a group-message by the given ID
+  EVENTS_EXPORT void flush(const Events_ID& theID);
 };
 
 #endif