本文整理汇总了C++中AMDataSource::deregisterObserver方法的典型用法代码示例。如果您正苦于以下问题:C++ AMDataSource::deregisterObserver方法的具体用法?C++ AMDataSource::deregisterObserver怎么用?C++ AMDataSource::deregisterObserver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AMDataSource
的用法示例。
在下文中一共展示了AMDataSource::deregisterObserver方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onInputSourceDeleted
void AMAnalysisBlock::onInputSourceDeleted(void* deletedSource) {
// this implementation is just like calling setInputDataSources() with an empty list, except we don't want to call deregisterObserver() on the deleted input source. (In a single-threaded situation, this would be okay, but if the deleted() signal came through a queued signal-slot connection, then that object might already be deleted)
for(int i=0; i<inputDataSourceCount(); i++) {
AMDataSource* oldSource = inputDataSourceAt(i);
if(oldSource != deletedSource) {
disconnect(oldSource->signalSource(), SIGNAL(deleted(void*)), this, SLOT(onInputSourceDeleted(void*)));
oldSource->deregisterObserver(this);
}
}
示例2: setInputDataSources
bool AMAnalysisBlock::setInputDataSources(const QList<AMDataSource*>& dataSources) {
// if a non-empty set of data sources has been provided, and they are not acceptable, return false. (An empty list must always be acceptable)
if(!dataSources.isEmpty() && !areInputDataSourcesAcceptable(dataSources)) {
AMErrorMon::report(AMErrorReport(this, AMErrorReport::Alert, -98, QString("There was an error connecting the input data sources to this analysis component '%1: %2'. The data sources provided weren't acceptable. This can happen if they have the wrong dimension, don't provide enough data, etc.").arg(name()).arg(description())));
return false;
}
for(int i=0; i<inputDataSourceCount(); i++) {
AMDataSource* oldSource = inputDataSourceAt(i);
disconnect(oldSource->signalSource(), SIGNAL(deleted(void*)), this, SLOT(onInputSourceDeleted(void*)));
oldSource->deregisterObserver(this);
}
for(int i=0; i<dataSources.count(); i++) {
AMDataSource* newSource = dataSources.at(i);
connect(newSource->signalSource(), SIGNAL(deleted(void*)), this, SLOT(onInputSourceDeleted(void*)));
dataSources.at(i)->registerObserver(this);
}
setInputDataSourcesImplementation(dataSources);
emit inputSourcesChanged();
return true;
}