+ enum event_type
+ {
+ ALGO_EVENT, COMPUTE_EVENT
+ };
+
+ // ==================================================================
+ // Members to track non hierarchical dependencies between submeshes
+ // ==================================================================
+
+ /*!
+ * \brief Sets an event listener and its data to a submesh
+ * \param listener - the listener to store
+ * \param data - the listener data to store
+ * \param where - the submesh to store the listener and it's data
+ *
+ * The method remembers the submesh \awhere it puts the listener in order to delete
+ * them when HYP_OK algo_state is lost
+ * After being set, event listener is notified on each event of \awhere submesh.
+ */
+ void SetEventListener(EventListener* listener,
+ EventListenerData* data,
+ SMESH_subMesh* where);
+
+ /*!
+ * \brief Return an event listener data
+ * \param listener - the listener whose data is
+ * \retval EventListenerData* - found data, maybe NULL
+ */
+ EventListenerData* GetEventListenerData(EventListener* listener) const;
+
+ /*!
+ * \brief Unregister the listener and delete it and it's data
+ * \param listener - the event listener to delete
+ */
+ void DeleteEventListener(EventListener* listener);
+
+protected:
+
+ //!< event listeners to notify
+ std::map< EventListener*, EventListenerData* > myEventListeners;
+ //!< event listeners to delete when HYP_OK algo_state is lost
+ std::list< std::pair< SMESH_subMesh*, EventListener* > > myOwnListeners;
+
+ /*!
+ * \brief Sets an event listener and its data to a submesh
+ * \param listener - the listener to store
+ * \param data - the listener data to store
+ *
+ * After being set, event listener is notified on each event of a submesh.
+ */
+ void SetEventListener(EventListener* listener, EventListenerData* data);
+
+ /*!
+ * \brief Notify stored event listeners on the occured event
+ * \param event - algo_event or compute_event itself
+ * \param eventType - algo_event or compute_event
+ * \param hyp - hypothesis, if eventType is algo_event
+ */
+ void NotifyListenersOnEvent( const int event,
+ const event_type eventType,
+ SMESH_Hypothesis* hyp = 0);
+
+ /*!
+ * \brief Delete event listeners depending on algo of this submesh
+ */
+ void DeleteOwnListeners();
+
+ // ==================================================================
+
+public: