Exemplo n.º 1
0
bool mafEventBusManager::removeEventProperty(const mafEvent &props) const {
    bool result(false);
    QString topic = props[TOPIC].toString();
    
    if(props.eventType() == mafEventTypeLocal) {
        // Local event dispatching.
        if(props[SIGTYPE].toInt() == mafSignatureTypeCallback) {
            result = m_LocalDispatcher->removeObserver(props);
        } else {
            result = m_LocalDispatcher->removeSignal(props);
            if (result){
                result = mafEventBus::mafTopicRegistry::instance()->unregisterTopic(topic);
            }
        }
    } else {
        // Remote event dispatching.
        if(props[SIGTYPE].toInt() == mafSignatureTypeCallback) {
            result = m_RemoteDispatcher->removeObserver(props);
        } else {
            result = m_RemoteDispatcher->removeSignal(props);
            if (result){
                result = mafEventBus::mafTopicRegistry::instance()->unregisterTopic(topic);
            }
        }
    }
    return result;
}
Exemplo n.º 2
0
bool mafEventBusManager::removeEventProperty(const mafEvent &props) const {
    if(props.eventType() == mafEventTypeLocal) {
        // Local event dispatching.
        if(props[SIGTYPE].toInt() == mafSignatureTypeCallback) {
            return m_LocalDispatcher->removeObserver(props);
        } else {
            return m_LocalDispatcher->removeSignal(props);
        }
    } else {
        // Remote event dispatching.
        if(props[SIGTYPE].toInt() == mafSignatureTypeCallback) {
            return m_RemoteDispatcher->removeObserver(props);
        } else {
            return m_RemoteDispatcher->removeSignal(props);
        }
    }
    return false;
}