return 0;
}
+//================================================================================
+/*!
+ * \brief Return an event listener data
+ * \param listenerName - the listener name
+ * \retval EventListenerData* - found data, maybe NULL
+ */
+//================================================================================
+
+EventListenerData* SMESH_subMesh::GetEventListenerData(const string& listenerName) const
+{
+ map< EventListener*, EventListenerData* >::const_iterator l_d = _eventListeners.begin();
+ for ( ; l_d != _eventListeners.end(); ++l_d )
+ if ( listenerName == l_d->first->GetName() )
+ return l_d->second;
+ return 0;
+}
+
//================================================================================
/*!
* \brief Notify stored event listeners on the occured event
map< EventListener*, EventListenerData* >::iterator l_d =
_eventListeners.find( listener );
if ( l_d != _eventListeners.end() ) {
- if ( l_d->first && l_d->first->IsDeletable() ) delete l_d->first;
- if ( l_d->second && l_d->second->IsDeletable() ) delete l_d->second;
+ if ( l_d->first && l_d->first->IsDeletable() )
+ {
+ l_d->first->BeforeDelete( this, l_d->second );
+ delete l_d->first;
+ }
+ if ( l_d->second && l_d->second->IsDeletable() )
+ {
+ delete l_d->second;
+ }
_eventListeners.erase( l_d );
}
}
*/
EventListenerData* GetEventListenerData(EventListener* listener) const;
+ /*!
+ * \brief Return an event listener data
+ * \param listenerName - the listener name
+ * \retval EventListenerData* - found data, maybe NULL
+ */
+ EventListenerData* GetEventListenerData(const std::string& listenerName) const;
+
/*!
* \brief Unregister the listener and delete it and it's data
* \param listener - the event listener to delete