]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Move Events messages to boost pointers: partially done
authormpv <mikhail.ponikarov@opencascade.com>
Mon, 15 Sep 2014 08:17:35 +0000 (12:17 +0400)
committermpv <mikhail.ponikarov@opencascade.com>
Mon, 15 Sep 2014 08:17:35 +0000 (12:17 +0400)
16 files changed:
src/Config/Config_FeatureReader.cpp
src/Config/Config_FeatureReader.h
src/Config/Config_XMLReader.cpp
src/Events/Events_Error.cpp
src/Events/Events_Listener.h
src/Events/Events_LongOp.cpp
src/Events/Events_Loop.cpp
src/Events/Events_Loop.h
src/Events/Events_MessageGroup.h
src/Model/Model_Events.cpp
src/Model/Model_Events.h
src/Model/Model_Session.cpp
src/Model/Model_Session.h
src/Model/Model_Update.cpp
src/Model/Model_Update.h
src/ModelAPI/ModelAPI_Events.h

index 69d7176e4f22c195114462d25f64a0b0479afdd2..19f4499e8e2660f19cc8cf2d1f72d9a3463e248c 100644 (file)
@@ -47,11 +47,12 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode)
   Events_ID aMenuItemEvent = Events_Loop::eventByName(myEventGenerated);
   if (isNode(theNode, NODE_FEATURE, NULL)) {
     Events_Loop* aEvLoop = Events_Loop::loop();
-    Config_FeatureMessage aMessage(aMenuItemEvent, this);
+    boost::shared_ptr<Config_FeatureMessage> aMessage(
+      new Config_FeatureMessage(aMenuItemEvent, this));
     fillFeature(theNode, aMessage);
     myFeatures.push_back(getProperty(theNode, _ID));
     //If a feature has xml definition for it's widget:
-    aMessage.setUseInput(hasChild(theNode));
+    aMessage->setUseInput(hasChild(theNode));
     aEvLoop->send(aMessage);
     //The m_last* variables always defined before fillFeature() call. XML is a tree.
   } else if (isNode(theNode, NODE_GROUP, NULL)) {
@@ -68,24 +69,25 @@ bool Config_FeatureReader::processChildren(xmlNodePtr theNode)
   return isNode(theNode, NODE_WORKBENCH, NODE_GROUP, NODE_FEATURE, NULL);
 }
 
-void Config_FeatureReader::fillFeature(xmlNodePtr theNode, Config_FeatureMessage& outFeatureMessage)
+void Config_FeatureReader::fillFeature(xmlNodePtr theNode, 
+  const boost::shared_ptr<Config_FeatureMessage>& outFeatureMessage)
 {
-  outFeatureMessage.setId(getProperty(theNode, _ID));
-  outFeatureMessage.setPluginLibrary(myLibraryName);
-  outFeatureMessage.setNestedFeatures(getProperty(theNode, FEATURE_NESTED));
+  outFeatureMessage->setId(getProperty(theNode, _ID));
+  outFeatureMessage->setPluginLibrary(myLibraryName);
+  outFeatureMessage->setNestedFeatures(getProperty(theNode, FEATURE_NESTED));
 
   bool isInternal = isInternalFeature(theNode);
-  outFeatureMessage.setInternal(isInternal);
+  outFeatureMessage->setInternal(isInternal);
   if (isInternal) {
     //Internal feature has no visual representation.
     return;
   }
-  outFeatureMessage.setText(getProperty(theNode, FEATURE_TEXT));
-  outFeatureMessage.setTooltip(getProperty(theNode, FEATURE_TOOLTIP));
-  outFeatureMessage.setIcon(getProperty(theNode, FEATURE_ICON));
-  outFeatureMessage.setKeysequence(getProperty(theNode, FEATURE_KEYSEQUENCE));
-  outFeatureMessage.setGroupId(myLastGroup);
-  outFeatureMessage.setWorkbenchId(myLastWorkbench);
+  outFeatureMessage->setText(getProperty(theNode, FEATURE_TEXT));
+  outFeatureMessage->setTooltip(getProperty(theNode, FEATURE_TOOLTIP));
+  outFeatureMessage->setIcon(getProperty(theNode, FEATURE_ICON));
+  outFeatureMessage->setKeysequence(getProperty(theNode, FEATURE_KEYSEQUENCE));
+  outFeatureMessage->setGroupId(myLastGroup);
+  outFeatureMessage->setWorkbenchId(myLastWorkbench);
 }
 
 bool Config_FeatureReader::isInternalFeature(xmlNodePtr theNode)
index f7547785ce39c245a18bbf8e381018351b2a4b4c..c9535c34bf72e4ca9d25aaa9fdcdf9799af895e0 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <Config_def.h>
 #include <Config_XMLReader.h>
+#include <boost/shared_ptr.hpp>
 
 #include <string>
 #include <list>
@@ -29,7 +30,8 @@ class Config_FeatureReader : public Config_XMLReader
   void processNode(xmlNodePtr aNode);
   bool processChildren(xmlNodePtr aNode);
 
-  void fillFeature(xmlNodePtr theRoot, Config_FeatureMessage& outFeatureMessage);
+  void fillFeature(xmlNodePtr theRoot, 
+    const boost::shared_ptr<Config_FeatureMessage>& outFeatureMessage);
   bool isInternalFeature(xmlNodePtr theRoot);
 
  private:
index 26da54b51d7f316cc77427cb8ededff4f4652159..3b206f3ce7a5717fa0a27b3d2613d30f0ecd7b10 100644 (file)
@@ -155,18 +155,19 @@ void Config_XMLReader::processValidator(xmlNodePtr theNode)
 {
   Events_ID aValidatoEvent = Events_Loop::eventByName(EVENT_VALIDATOR_LOADED);
   Events_Loop* aEvLoop = Events_Loop::loop();
-  Config_ValidatorMessage aMessage(aValidatoEvent, this);
+  boost::shared_ptr<Config_ValidatorMessage> 
+    aMessage(new Config_ValidatorMessage(aValidatoEvent, this));
   std::string aValidatorId;
   std::list<std::string> aValidatorParameters;
   getValidatorInfo(theNode, aValidatorId, aValidatorParameters);
-  aMessage.setValidatorId(aValidatorId);
-  aMessage.setValidatorParameters(aValidatorParameters);
+  aMessage->setValidatorId(aValidatorId);
+  aMessage->setValidatorParameters(aValidatorParameters);
   xmlNodePtr aFeatureOrWdgNode = theNode->parent;
   if (isNode(aFeatureOrWdgNode, NODE_FEATURE, NULL)) {
-    aMessage.setFeatureId(getProperty(aFeatureOrWdgNode, _ID));
+    aMessage->setFeatureId(getProperty(aFeatureOrWdgNode, _ID));
   } else {
-    aMessage.setAttributeId(getProperty(aFeatureOrWdgNode, _ID));
-    aMessage.setFeatureId(myCurrentFeature);
+    aMessage->setAttributeId(getProperty(aFeatureOrWdgNode, _ID));
+    aMessage->setFeatureId(myCurrentFeature);
   }
   aEvLoop->send(aMessage);
 }
index 7fe307b6a9c16d08ec78f537494cabf6439c7343..3ac990edb5893922ecb85a3cca24c1fe0276055c 100644 (file)
@@ -31,8 +31,9 @@ char* Events_Error::description() const
 
 void Events_Error::send(char* theDescription, const void* theSender)
 {
-  Events_Error anError(theDescription, theSender);
-  Events_Loop::loop()->send(anError);
+  boost::shared_ptr<Events_Message> aNewOne = 
+    boost::shared_ptr<Events_Message>(new Events_Error(theDescription, theSender));
+  Events_Loop::loop()->send(aNewOne);
 }
 
 void Events_Error::send(std::string theDescription, const void* theSender)
index ac7714f021520c589d8571b4ecf6d0ffbbc8480f..f59bbd2f9d36de78f3cbb9839b06a3d20c889eaf 100644 (file)
@@ -6,6 +6,8 @@
 #define Events_Listener_H_
 
 #include <Events.h>
+#include <boost/shared_ptr.hpp>
+
 class Events_Message;
 
 /**\class Events_Listener
@@ -20,7 +22,7 @@ class EVENTS_EXPORT Events_Listener
 
  public:
   //! This method is called by loop when the event is started to process.
-  virtual void processEvent(const Events_Message* theMessage) = 0;
+  virtual void processEvent(const boost::shared_ptr<Events_Message>& theMessage) = 0;
 };
 
 #endif
index b4718608a518bfa47cd59bc31e879c95b68fbcbc..75b7a0dfdaa1e72372742c3b15483d6430396b97 100644 (file)
@@ -33,8 +33,9 @@ void Events_LongOp::start(void* theSender)
     MY_SENDERS[theSender]++;
 
   if (toSend) {
-    Events_LongOp anEvent(theSender);
-    Events_Loop::loop()->send(anEvent);
+    boost::shared_ptr<Events_Message> aNewOne = 
+      boost::shared_ptr<Events_Message>(new Events_LongOp(theSender));
+    Events_Loop::loop()->send(aNewOne);
   }
 }
 
@@ -48,8 +49,9 @@ void Events_LongOp::end(void* theSender)
       MY_SENDERS[theSender] = aCount - 1;
   }
   if (MY_SENDERS.empty()) {
-    Events_LongOp anEvent(theSender);
-    Events_Loop::loop()->send(anEvent);
+    boost::shared_ptr<Events_Message> aNewOne = 
+      boost::shared_ptr<Events_Message>(new Events_LongOp(theSender));
+    Events_Loop::loop()->send(aNewOne);
   }
 }
 
index 1fb0ed1780636c244923a3b50469ce0e68ab22f4..04d94b0889335ae474333826d3a32f240f4131ae 100644 (file)
@@ -37,19 +37,22 @@ Events_ID Events_Loop::eventByName(const char* theName)
   return Events_ID(aResult);
 }
 
-void Events_Loop::send(Events_Message& theMessage, bool isGroup)
+void Events_Loop::send(const boost::shared_ptr<Events_Message>& theMessage, bool isGroup)
 {
   // if it is grouped message, just accumulate it
   if (isGroup) {
-    Events_MessageGroup* aGroup = dynamic_cast<Events_MessageGroup*>(&theMessage);
+    boost::shared_ptr<Events_MessageGroup> aGroup = 
+      boost::dynamic_pointer_cast<Events_MessageGroup>(theMessage);
     if (aGroup) {
-      std::map<char*, Events_MessageGroup*>::iterator aMyGroup = myGroups.find(
+      std::map<char*, boost::shared_ptr<Events_Message> >::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());
       }
-      aMyGroup->second->Join(*aGroup);
+      boost::shared_ptr<Events_MessageGroup> aNewOne =
+        boost::dynamic_pointer_cast<Events_MessageGroup>(aMyGroup->second);
+      aGroup->Join(aNewOne);
       return;
     }
   }
@@ -57,21 +60,21 @@ void Events_Loop::send(Events_Message& theMessage, bool isGroup)
   // TO DO: make it in thread and with usage of semaphores
 
   map<char*, map<void*, list<Events_Listener*> > >::iterator aFindID = myListeners.find(
-      theMessage.eventID().eventText());
+      theMessage->eventID().eventText());
   if (aFindID != myListeners.end()) {
     map<void*, list<Events_Listener*> >::iterator aFindSender = aFindID->second.find(
-        theMessage.sender());
+        theMessage->sender());
     if (aFindSender != aFindID->second.end()) {
       list<Events_Listener*>& aListeners = aFindSender->second;
       for (list<Events_Listener*>::iterator aL = aListeners.begin(); aL != aListeners.end(); aL++)
-        (*aL)->processEvent(&theMessage);
+        (*aL)->processEvent(theMessage);
     }
-    if (theMessage.sender()) {  // also call for NULL senders registered
+    if (theMessage->sender()) {  // also call for NULL senders registered
       aFindSender = aFindID->second.find(NULL);
       if (aFindSender != aFindID->second.end()) {
         list<Events_Listener*>& aListeners = aFindSender->second;
         for (list<Events_Listener*>::iterator aL = aListeners.begin(); aL != aListeners.end(); aL++)
-          (*aL)->processEvent(&theMessage);
+          (*aL)->processEvent(theMessage);
       }
     }
   }
@@ -105,12 +108,12 @@ void Events_Loop::flush(const Events_ID& theID)
 {
   if (!myFlushActive)
     return;
-  std::map<char*, Events_MessageGroup*>::iterator aMyGroup = myGroups.find(theID.eventText());
+  std::map<char*, boost::shared_ptr<Events_Message>>::iterator aMyGroup =
+    myGroups.find(theID.eventText());
   if (aMyGroup != myGroups.end()) {  // really sends
-    Events_MessageGroup* aGroup = aMyGroup->second;
+    boost::shared_ptr<Events_Message> aGroup = aMyGroup->second;
     myGroups.erase(aMyGroup);
-    send(*aGroup, false);
-    delete aGroup;
+    send(aGroup, false);
   }
 }
 
index cd78497ed1c67b0c7b3482d5964df9b49674572b..3a02e16a659c6c4e1a2dcffa4bb948240434ecdd 100644 (file)
@@ -29,7 +29,7 @@ class Events_Loop
   std::map<char*, std::map<void*, std::list<Events_Listener*> > > myListeners;
 
   /// map from event ID to groupped messages (accumulated on flush)
-  std::map<char*, Events_MessageGroup*> myGroups;
+  std::map<char*, boost::shared_ptr<Events_Message> > myGroups;
 
   /// to process flushes or not
   bool myFlushActive;
@@ -46,7 +46,7 @@ class Events_Loop
 
   //! Allows to send an event
   //! \param isGroup is true for grouping messages if possible
-  EVENTS_EXPORT void send(Events_Message& theMessage, bool isGroup = true);
+  EVENTS_EXPORT void send(const boost::shared_ptr<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
index 232c8d1b636a5b04adf93dfe4f181d53be447b01..46c765cce99a9aab7b870674fe0817ff46f6cccf 100644 (file)
@@ -6,6 +6,7 @@
 #define Events_MessageGroup_H_
 
 #include <Events_Message.h>
+#include <boost/shared_ptr.hpp>
 
 /**\class Events_Message
  * \ingroup EventsLoop
@@ -30,9 +31,9 @@ class EVENTS_EXPORT Events_MessageGroup : public Events_Message
   }
 
   //! Creates a new empty group (to store it in the loop before flush)
-  virtual Events_MessageGroup* newEmpty() = 0;
+  virtual boost::shared_ptr<Events_MessageGroup> newEmpty() = 0;
   //! Allows to join the given message with the current one
-  virtual void Join(Events_MessageGroup& theJoined) = 0;
+  virtual void Join(const boost::shared_ptr<Events_MessageGroup>& theJoined) = 0;
 };
 
 #endif
index ae785563cf2c9f02c1cbf44f0201fe29d7352033..0d421704ba56c4eac5ecf8b8cafe0212d2a4ec83 100644 (file)
@@ -12,14 +12,16 @@ Model_EventCreator MY_CREATOR;
 void Model_EventCreator::sendUpdated(const ObjectPtr& theObject, const Events_ID& theEvent,
                                      const bool isGroupped) const
 {
-  Model_ObjectUpdatedMessage aMsg(theObject, theEvent);
+  boost::shared_ptr<Model_ObjectUpdatedMessage> aMsg(
+    new Model_ObjectUpdatedMessage(theObject, theEvent));
   Events_Loop::loop()->send(aMsg, isGroupped);
 }
 
 void Model_EventCreator::sendDeleted(const boost::shared_ptr<ModelAPI_Document>& theDoc,
                                      const std::string& theGroup) const
 {
-  Model_ObjectDeletedMessage aMsg(theDoc, theGroup);
+  boost::shared_ptr<Model_ObjectDeletedMessage> aMsg(
+    new Model_ObjectDeletedMessage(theDoc, theGroup));
   Events_Loop::loop()->send(aMsg, true);
 }
 
@@ -42,15 +44,17 @@ std::set<ObjectPtr> Model_ObjectUpdatedMessage::objects() const
   return myObjects;
 }
 
-Events_MessageGroup* Model_ObjectUpdatedMessage::newEmpty()
+boost::shared_ptr<Events_MessageGroup> Model_ObjectUpdatedMessage::newEmpty()
 {
   ObjectPtr anEmptyObject;
-  return new Model_ObjectUpdatedMessage(anEmptyObject, eventID());
+  return boost::shared_ptr<Model_ObjectUpdatedMessage>(
+    new Model_ObjectUpdatedMessage(anEmptyObject, eventID()));
 }
 
-void Model_ObjectUpdatedMessage::Join(Events_MessageGroup& theJoined)
+void Model_ObjectUpdatedMessage::Join(const boost::shared_ptr<Events_MessageGroup>& theJoined)
 {
-  Model_ObjectUpdatedMessage* aJoined = dynamic_cast<Model_ObjectUpdatedMessage*>(&theJoined);
+  boost::shared_ptr<Model_ObjectUpdatedMessage> aJoined = 
+    boost::dynamic_pointer_cast<Model_ObjectUpdatedMessage>(theJoined);
   std::set<ObjectPtr>::iterator aFIter = aJoined->myObjects.begin();
   for (; aFIter != aJoined->myObjects.end(); aFIter++) {
     myObjects.insert(*aFIter);
@@ -67,9 +71,9 @@ Model_ObjectDeletedMessage::Model_ObjectDeletedMessage(
     myGroups.insert(theGroup);
 }
 
-Events_MessageGroup* Model_ObjectDeletedMessage::newEmpty()
+boost::shared_ptr<Events_MessageGroup> Model_ObjectDeletedMessage::newEmpty()
 {
-  return new Model_ObjectDeletedMessage(myDoc, "");
+  return boost::shared_ptr<Model_ObjectDeletedMessage>(new Model_ObjectDeletedMessage(myDoc, ""));
 }
 
 const Events_ID Model_ObjectDeletedMessage::messageId()
@@ -78,9 +82,10 @@ const Events_ID Model_ObjectDeletedMessage::messageId()
   return MY_ID;
 }
 
-void Model_ObjectDeletedMessage::Join(Events_MessageGroup& theJoined)
+void Model_ObjectDeletedMessage::Join(const boost::shared_ptr<Events_MessageGroup>& theJoined)
 {
-  Model_ObjectDeletedMessage* aJoined = dynamic_cast<Model_ObjectDeletedMessage*>(&theJoined);
+  boost::shared_ptr<Model_ObjectDeletedMessage> aJoined = 
+    boost::dynamic_pointer_cast<Model_ObjectDeletedMessage>(theJoined);
   std::set<std::string>::iterator aGIter = aJoined->myGroups.begin();
   for (; aGIter != aJoined->myGroups.end(); aGIter++) {
     myGroups.insert(*aGIter);
index c9b59c3c6ab1e875cf1607defae0212131d26ff8..74d38a7fdebe194b74d132f1526dd4ba4242fd6a 100644 (file)
@@ -39,10 +39,10 @@ class Model_ObjectUpdatedMessage : public ModelAPI_ObjectUpdatedMessage
   virtual std::set<ObjectPtr> objects() const;
 
   //! Creates a new empty group (to store it in the loop before flush)
-  virtual Events_MessageGroup* newEmpty();
+  virtual boost::shared_ptr<Events_MessageGroup> newEmpty();
 
   //! Allows to join the given message with the current one
-  virtual void Join(Events_MessageGroup& theJoined);
+  virtual void Join(const boost::shared_ptr<Events_MessageGroup>& theJoined);
 };
 
 /// Message that feature was deleted (used for Object Browser update)
@@ -69,11 +69,11 @@ class Model_ObjectDeletedMessage : public ModelAPI_ObjectDeletedMessage
     return myGroups;
   }
 
-  virtual Events_MessageGroup* newEmpty();
+  virtual boost::shared_ptr<Events_MessageGroup> newEmpty();
 
   virtual const Events_ID messageId();
 
-  virtual void Join(Events_MessageGroup& theJoined);
+  virtual void Join(const boost::shared_ptr<Events_MessageGroup>& theJoined);
 };
 
 #endif
index 3bc3dee03835ddcda2adbe36cc71b32d77e9b1d1..d0879860ccb32a0a9655e0a899497acdd431ad28 100644 (file)
@@ -135,7 +135,7 @@ void Model_Session::setActiveDocument(boost::shared_ptr<ModelAPI_Document> theDo
 {
   if (myCurrentDoc != theDoc) {
     myCurrentDoc = theDoc;
-    static Events_Message aMsg(Events_Loop::eventByName("CurrentDocumentChanged"));
+    static boost::shared_ptr<Events_Message> aMsg(new Events_Message(Events_Loop::eventByName("CurrentDocumentChanged")));
     Events_Loop::loop()->send(aMsg);
   }
 }
@@ -176,12 +176,13 @@ Model_Session::Model_Session()
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_VALIDATOR_LOADED));
 }
 
-void Model_Session::processEvent(const Events_Message* theMessage)
+void Model_Session::processEvent(const boost::shared_ptr<Events_Message>& theMessage)
 {
   static const Events_ID kFeatureEvent = Events_Loop::eventByName("FeatureRegisterEvent");
   static const Events_ID kValidatorEvent = Events_Loop::eventByName(EVENT_VALIDATOR_LOADED);
   if (theMessage->eventID() == kFeatureEvent) {
-    const Config_FeatureMessage* aMsg = dynamic_cast<const Config_FeatureMessage*>(theMessage);
+    const boost::shared_ptr<Config_FeatureMessage> aMsg = 
+      boost::dynamic_pointer_cast<Config_FeatureMessage>(theMessage);
     if (aMsg) {
       // proccess the plugin info, load plugin
       if (myPlugins.find(aMsg->id()) == myPlugins.end()) {
@@ -191,7 +192,8 @@ void Model_Session::processEvent(const Events_Message* theMessage)
     // plugins information was started to load, so, it will be loaded
     myPluginsInfoLoaded = true;
   } else if (theMessage->eventID() == kValidatorEvent) {
-    const Config_ValidatorMessage* aMsg = dynamic_cast<const Config_ValidatorMessage*>(theMessage);
+    boost::shared_ptr<Config_ValidatorMessage> aMsg = 
+      boost::dynamic_pointer_cast<Config_ValidatorMessage>(theMessage);
     if (aMsg) {
       if (aMsg->attributeId().empty()) {  // feature validator
         validators()->assignValidator(aMsg->validatorId(), aMsg->featureId(), aMsg->parameters());
index 5ee656025d1cf71e3da7fbab5e49423a085f7295..845d93f7efbf7b6724a7e9a9aafd8b6b28146246 100644 (file)
@@ -81,7 +81,7 @@ class Model_Session : public ModelAPI_Session, public Events_Listener
   MODEL_EXPORT virtual void registerPlugin(ModelAPI_Plugin* thePlugin);
 
   /// Processes the configuration file reading
-  MODEL_EXPORT virtual void processEvent(const Events_Message* theMessage);
+  MODEL_EXPORT virtual void processEvent(const boost::shared_ptr<Events_Message>& theMessage);
 
   /// Copies the document to the new one wit hthe given id
   MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Document> copy(
index 380d12b3f0f52dfa072ec4ce7ff4bb269336fa62..848f38b80e2d008f29d8e3563159665726dd51f3 100644 (file)
@@ -27,14 +27,14 @@ Model_Update::Model_Update()
   Events_Loop::loop()->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
 }
 
-void Model_Update::processEvent(const Events_Message* theMessage)
+void Model_Update::processEvent(const boost::shared_ptr<Events_Message>& theMessage)
 {
   if (isExecuted)
     return;  // nothing to do: it is executed now
   //Events_LongOp::start(this);
   isExecuted = true;
-  const ModelAPI_ObjectUpdatedMessage* aMsg =
-      dynamic_cast<const ModelAPI_ObjectUpdatedMessage*>(theMessage);
+  boost::shared_ptr<ModelAPI_ObjectUpdatedMessage> aMsg =
+      boost::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
   myInitial = aMsg->objects();
   // collect all documents involved into the update
   set<boost::shared_ptr<ModelAPI_Document> > aDocs;
index ee3efc79cd7387122cc2face214637606266d4eb..5cfa0252743e2369721fb599a02050bb1f7f7a52 100644 (file)
@@ -31,7 +31,7 @@ class Model_Update : public Events_Listener
   Model_Update();
 
   /// Processes the feature argument update: executes the results
-  MODEL_EXPORT virtual void processEvent(const Events_Message* theMessage);
+  MODEL_EXPORT virtual void processEvent(const boost::shared_ptr<Events_Message>& theMessage);
 
  protected:
   /// Recoursively checks and updates the feature if needed (calls the execute method)
index c35573168d23c8eeaaa68a642e5be0eb616f2ac7..b2b9add754c302610ffcf72e5e768c3b6294a2a8 100644 (file)
@@ -44,10 +44,10 @@ class ModelAPI_ObjectUpdatedMessage : public Events_MessageGroup
   virtual std::set<ObjectPtr> objects() const = 0;
 
   //! Creates a new empty group (to store it in the loop before flush)
-  virtual Events_MessageGroup* newEmpty() = 0;
+  virtual boost::shared_ptr<Events_MessageGroup> newEmpty() = 0;
 
   //! Allows to join the given message with the current one
-  virtual void Join(Events_MessageGroup& theJoined) = 0;
+  virtual void Join(const boost::shared_ptr<Events_MessageGroup>& theJoined) = 0;
 };
 
 /// Message that feature was deleted (used for Object Browser update)
@@ -66,11 +66,11 @@ class ModelAPI_ObjectDeletedMessage : public Events_MessageGroup
   /// Returns the group where the feature was deleted
   virtual const std::set<std::string>& groups() const = 0;
 
-  virtual Events_MessageGroup* newEmpty() = 0;
+  virtual boost::shared_ptr<Events_MessageGroup> newEmpty() = 0;
 
   virtual const Events_ID messageId() = 0;
 
-  virtual void Join(Events_MessageGroup& theJoined) = 0;
+  virtual void Join(const boost::shared_ptr<Events_MessageGroup>& theJoined) = 0;
 };
 
 /// Allows to create ModelAPI messages