Model_OrderUpdatedMessage::Model_OrderUpdatedMessage(
const std::shared_ptr<ModelAPI_Document>& theDoc, const std::string& theGroup)
: ModelAPI_OrderUpdatedMessage(messageId(), 0),
- myDoc(theDoc)
+ myDoc(theDoc), myGroup(theGroup)
{
- if (!theGroup.empty())
- myGroups.insert(theGroup);
-}
-
-std::shared_ptr<Events_MessageGroup> Model_OrderUpdatedMessage::newEmpty()
-{
- return std::shared_ptr<Model_OrderUpdatedMessage>(new Model_OrderUpdatedMessage(myDoc, ""));
}
const Events_ID Model_OrderUpdatedMessage::messageId()
static Events_ID MY_ID = Events_Loop::eventByName(EVENT_ORDER_UPDATED);
return MY_ID;
}
-
-void Model_OrderUpdatedMessage::Join(const std::shared_ptr<Events_MessageGroup>& theJoined)
-{
- std::shared_ptr<Model_OrderUpdatedMessage> aJoined =
- std::dynamic_pointer_cast<Model_OrderUpdatedMessage>(theJoined);
- std::set<std::string>::iterator aGIter = aJoined->myGroups.begin();
- for (; aGIter != aJoined->myGroups.end(); aGIter++) {
- myGroups.insert(*aGIter);
- }
-}
class Model_OrderUpdatedMessage : public ModelAPI_OrderUpdatedMessage
{
std::shared_ptr<ModelAPI_Document> myDoc; ///< document owner of the feature
- std::set<std::string> myGroups; ///< group identifiers that contained the deleted feature
+ std::string myGroup; ///< group identifier that contained the deleted feature
/// Use ModelAPI for creation of this event.
Model_OrderUpdatedMessage(const std::shared_ptr<ModelAPI_Document>& theDoc,
}
/// Returns the group where the objects were reordered
- virtual const std::set<std::string>& groups() const
+ virtual const std::string& group() const
{
- return myGroups;
+ return myGroup;
}
- /// Returns the new empty message of this type
- virtual std::shared_ptr<Events_MessageGroup> newEmpty();
-
/// Returns the identifier of this message
virtual const Events_ID messageId();
-
- /// Appends to this message the given one
- virtual void Join(const std::shared_ptr<Events_MessageGroup>& theJoined);
};
#endif
ModelAPI_OrderUpdatedMessage::ModelAPI_OrderUpdatedMessage(const Events_ID theID,
const void* theSender)
- : Events_MessageGroup(theID, theSender)
+ : Events_Message(theID, theSender)
{
}
};
/// Message that order changed (used for Object Browser update)
-class MODELAPI_EXPORT ModelAPI_OrderUpdatedMessage : public Events_MessageGroup
+class MODELAPI_EXPORT ModelAPI_OrderUpdatedMessage : public Events_Message
{
protected:
/// Creates an empty message
virtual std::shared_ptr<ModelAPI_Document> document() const = 0;
/// Returns the groups where the objects were reordered
- virtual const std::set<std::string>& groups() const = 0;
-
- /// Creates the new empty message of this kind
- virtual std::shared_ptr<Events_MessageGroup> newEmpty() = 0;
+ virtual const std::string& group() const = 0;
/// Returns the identifier of the kind of a message
virtual const Events_ID messageId() = 0;
-
- /// Appenad to this message the given one.
- virtual void Join(const std::shared_ptr<Events_MessageGroup>& theJoined) = 0;
};
/// Allows to create ModelAPI messages