]> SALOME platform Git repositories - modules/shaper.git/blob - src/Events/Events_MessageGroup.h
Salome HOME
Move Events messages to boost pointers: partially done
[modules/shaper.git] / src / Events / Events_MessageGroup.h
1 // File:        Events_MessageGroup.hxx
2 // Created:     Thu Mar 13 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef Events_MessageGroup_H_
6 #define Events_MessageGroup_H_
7
8 #include <Events_Message.h>
9 #include <boost/shared_ptr.hpp>
10
11 /**\class Events_Message
12  * \ingroup EventsLoop
13  * \brief Message that allows to group messages and send them later as a group of messages.
14  *
15  * Loop detects such messages and accumulates them without sending. On "flush" loop sends it
16  * as a group-message.
17  */
18 class EVENTS_EXPORT Events_MessageGroup : public Events_Message
19 {
20
21  public:
22
23   //! Creates the message
24   Events_MessageGroup(const Events_ID theID, const void* theSender = 0)
25       : Events_Message(theID, theSender)
26   {
27   }
28   //! do nothing in the destructor yet
29   virtual ~Events_MessageGroup()
30   {
31   }
32
33   //! Creates a new empty group (to store it in the loop before flush)
34   virtual boost::shared_ptr<Events_MessageGroup> newEmpty() = 0;
35   //! Allows to join the given message with the current one
36   virtual void Join(const boost::shared_ptr<Events_MessageGroup>& theJoined) = 0;
37 };
38
39 #endif