本文整理汇总了C++中ImageLayerVector::swap方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageLayerVector::swap方法的具体用法?C++ ImageLayerVector::swap怎么用?C++ ImageLayerVector::swap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageLayerVector
的用法示例。
在下文中一共展示了ImageLayerVector::swap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lock
void
Map::clear()
{
ImageLayerVector imageLayersRemoved;
ElevationLayerVector elevLayersRemoved;
ModelLayerVector modelLayersRemoved;
MaskLayerVector maskLayersRemoved;
Revision newRevision;
{
Threading::ScopedWriteLock lock( _mapDataMutex );
imageLayersRemoved.swap( _imageLayers );
elevLayersRemoved.swap ( _elevationLayers );
modelLayersRemoved.swap( _modelLayers );
// calculate a new revision.
newRevision = ++_dataModelRevision;
}
// a separate block b/c we don't need the mutex
for( MapCallbackList::iterator i = _mapCallbacks.begin(); i != _mapCallbacks.end(); i++ )
{
for( ImageLayerVector::iterator k = imageLayersRemoved.begin(); k != imageLayersRemoved.end(); ++k )
i->get()->onMapModelChanged( MapModelChange(MapModelChange::REMOVE_IMAGE_LAYER, newRevision, k->get()) );
for( ElevationLayerVector::iterator k = elevLayersRemoved.begin(); k != elevLayersRemoved.end(); ++k )
i->get()->onMapModelChanged( MapModelChange(MapModelChange::REMOVE_ELEVATION_LAYER, newRevision, k->get()) );
for( ModelLayerVector::iterator k = modelLayersRemoved.begin(); k != modelLayersRemoved.end(); ++k )
i->get()->onMapModelChanged( MapModelChange(MapModelChange::REMOVE_MODEL_LAYER, newRevision, k->get()) );
}
}