-class Model_FeatureUpdatedMessage : public Events_MessageGroup {
- std::set<boost::shared_ptr<ModelAPI_Feature> > myFeatures; ///< which feature is changed
-public:
- /// sender is not important, all information is located in the feature
- Model_FeatureUpdatedMessage(
- const boost::shared_ptr<ModelAPI_Feature>& theFeature,
- const Events_ID& theEvent) : Events_MessageGroup(theEvent, 0)
- {if (theFeature) myFeatures.insert(theFeature);}
-
- /// Returns the feature that has been updated
- std::set<boost::shared_ptr<ModelAPI_Feature> > features() const {return myFeatures;}
-
- //! Creates a new empty group (to store it in the loop before flush)
- virtual Events_MessageGroup* newEmpty() {
- boost::shared_ptr<ModelAPI_Feature> anEmptyFeature;
- return new Model_FeatureUpdatedMessage(anEmptyFeature, eventID());
- }
-
- //! Allows to join the given message with the current one
- virtual void Join(Events_MessageGroup& theJoined) {
- Model_FeatureUpdatedMessage* aJoined = dynamic_cast<Model_FeatureUpdatedMessage*>(&theJoined);
- std::set<boost::shared_ptr<ModelAPI_Feature> >::iterator aFIter = aJoined->myFeatures.begin();
- for(; aFIter != aJoined->myFeatures.end(); aFIter++) {
- myFeatures.insert(*aFIter);
- }
- }
-};