コード例 #1
0
ファイル: mafEventBusManager.cpp プロジェクト: weihui/MAF
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;
}
コード例 #2
0
ファイル: mafEventBusManager.cpp プロジェクト: gdoglz/MAF
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;
}