当前位置: 首页>>代码示例>>C++>>正文


C++ scopedLocker函数代码示例

本文整理汇总了C++中scopedLocker函数的典型用法代码示例。如果您正苦于以下问题:C++ scopedLocker函数的具体用法?C++ scopedLocker怎么用?C++ scopedLocker使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了scopedLocker函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: scopedLocker

void OsmAnd::MapMarker_P::setPosition(const PointI position)
{
    QWriteLocker scopedLocker(&_lock);

    _position = position;
    _hasUnappliedChanges = true;
}
开发者ID:brainbeanapps,项目名称:OsmAnd-core,代码行数:7,代码来源:MapMarker_P.cpp

示例2: scopedLocker

std::shared_ptr<OsmAnd::MapMarker> OsmAnd::MapMarkerBuilder_P::buildAndAddToCollection(
    const std::shared_ptr<MapMarkersCollection>& collection)
{
    QReadLocker scopedLocker(&_lock);

    // Construct map symbols group for this marker
    const std::shared_ptr<MapMarker> marker(new MapMarker(
        _baseOrder,
        _pinIcon,
        _pinIconAlignment,
        detachedOf(_onMapSurfaceIcons),
        _isAccuracyCircleSupported,
        _accuracyCircleBaseColor));
    marker->setIsHidden(_isHidden);
    if (_isAccuracyCircleSupported)
    {
        marker->setIsAccuracyCircleVisible(_isAccuracyCircleVisible);
        marker->setAccuracyCircleRadius(_accuracyCircleRadius);
    }
    marker->setPosition(_position);
    marker->setPinIconModulationColor(_pinIconModulationColor);
    marker->applyChanges();

    // Add marker to collection and return it if adding was successful
    if (!collection->_p->addMarker(marker))
        return nullptr;
    return marker;
}
开发者ID:biddyweb,项目名称:OsmAnd-core,代码行数:28,代码来源:MapMarkerBuilder_P.cpp

示例3: scopedLocker

bool OsmAnd::ObfsCollection_P::remove(const ObfsCollection::SourceOriginId entryId)
{
    QWriteLocker scopedLocker(&_sourcesOriginsLock);

    const auto itSourceOrigin = _sourcesOrigins.find(entryId);
    if (itSourceOrigin == _sourcesOrigins.end())
        return false;

    const auto& sourceOrigin = *itSourceOrigin;
    if (sourceOrigin->type == SourceOriginType::Directory)
    {
        const auto& directoryAsSourceOrigin = std::static_pointer_cast<const DirectoryAsSourceOrigin>(sourceOrigin);

        for(const auto watchedSubdirectory : constOf(directoryAsSourceOrigin->watchedSubdirectories))
            _fileSystemWatcher->removePath(watchedSubdirectory);
        _fileSystemWatcher->removePath(directoryAsSourceOrigin->directory.canonicalPath());
    }
    else if (sourceOrigin->type == SourceOriginType::File)
    {
        const auto& fileAsSourceOrigin = std::static_pointer_cast<const FileAsSourceOrigin>(sourceOrigin);

        _fileSystemWatcher->removePath(fileAsSourceOrigin->fileInfo.canonicalFilePath());
    }

    _sourcesOrigins.erase(itSourceOrigin);

    invalidateCollectedSources();

    return true;
}
开发者ID:rotorliu,项目名称:OsmAnd-core,代码行数:30,代码来源:ObfsCollection_P.cpp

示例4: collectSources

std::shared_ptr<OsmAnd::ObfDataInterface> OsmAnd::ObfsCollection_P::obtainDataInterface() const
{
    // Check if sources were invalidated
    if (_collectedSourcesInvalidated.loadAcquire() > 0)
        collectSources();

    // Create ObfReaders from collected sources
    QList< std::shared_ptr<const ObfReader> > obfReaders;
    {
        QReadLocker scopedLocker(&_collectedSourcesLock);

        for(const auto& collectedSources : constOf(_collectedSources))
        {
            obfReaders.reserve(obfReaders.size() + collectedSources.size());
            for(const auto& obfFile : constOf(collectedSources))
            {
                std::shared_ptr<const ObfReader> obfReader(new ObfReader(obfFile));
                if (!obfReader->isOpened() || !obfReader->obtainInfo())
                    continue;
                obfReaders.push_back(qMove(obfReader));
            }
        }
    }

    return std::shared_ptr<ObfDataInterface>(new ObfDataInterface(obfReaders));
}
开发者ID:rotorliu,项目名称:OsmAnd-core,代码行数:26,代码来源:ObfsCollection_P.cpp

示例5: scopedLocker

void OsmAnd::Concurrent::Dispatcher::shutdown()
{
    QMutexLocker scopedLocker(&_performedShutdownConditionMutex);

    shutdownAsync();

    REPEAT_UNTIL(_performedShutdown.wait(&_performedShutdownConditionMutex));
}
开发者ID:vmkrish,项目名称:OsmAnd-core,代码行数:8,代码来源:Concurrent.cpp

示例6: scopedLocker

QString OsmAnd::MapSymbolIntersectionClassesRegistry_P::getClassNameById(const ClassId classId) const
{
    QReadLocker scopedLocker(&_lock);

    if (_nameById.size() <= classId)
        return QString::null;
    return _nameById[classId];
}
开发者ID:SfietKonstantin,项目名称:OsmAnd-core,代码行数:8,代码来源:MapSymbolIntersectionClassesRegistry_P.cpp

示例7: scopedLocker

void OsmAnd::OnlineMapRasterTileProvider_P::unlockTile( const TileId tileId, const ZoomLevel zoom )
{
    QMutexLocker scopedLocker(&_tilesInProcessMutex);

    _tilesInProcess[zoom].remove(tileId);

    _waitUntilAnyTileIsProcessed.wakeAll();
}
开发者ID:dpitkevics,项目名称:OsmAnd-core,代码行数:8,代码来源:OnlineMapRasterTileProvider_P.cpp

示例8: scopedLocker

void OsmAnd::MapMarkerBuilder_P::addOnMapSurfaceIcon(
    const MapMarker::OnSurfaceIconKey key,
    const std::shared_ptr<const SkBitmap>& bitmap)
{
    QWriteLocker scopedLocker(&_lock);

    _onMapSurfaceIcons.insert(key, bitmap);
}
开发者ID:Zahnstocher,项目名称:OsmAnd-core,代码行数:8,代码来源:MapMarkerBuilder_P.cpp

示例9: scopedLocker

void OsmAnd::FavoriteLocationsCollection_P::clearFavoriteLocations()
{
	QWriteLocker scopedLocker(&_collectionLock);

	doClearFavoriteLocations();

	notifyCollectionChanged();
}
开发者ID:rotorliu,项目名称:OsmAnd-core,代码行数:8,代码来源:FavoriteLocationsCollection_P.cpp

示例10: scopedLocker

void OsmAnd::ObfFile_P::unlockFromWriting() const
{
    QMutexLocker scopedLocker(&_lockCounterMutex);

    assert(_lockCounter < 0);
    _lockCounter++;
    _lockCounterWaitCondition.wakeAll();
}
开发者ID:vmkrish,项目名称:OsmAnd-core,代码行数:8,代码来源:ObfFile_P.cpp

示例11: scopedLocker

unsigned int OsmAnd::BaseSearchEngine_P::removeAllDataSources()
{
    QWriteLocker scopedLocker(&_dataSourcesLock);

    const auto removedCount = _dataSources.size();
    _dataSources.clear();
    return removedCount;
}
开发者ID:SfietKonstantin,项目名称:OsmAnd-core,代码行数:8,代码来源:BaseSearchEngine_P.cpp

示例12: scopedLocker

void OsmAnd::TextRasterizer_P::clearFontsCache()
{
    QMutexLocker scopedLocker(&_fontTypefacesCacheMutex);

    for (const auto& typeface : _fontTypefacesCache)
        typeface->unref();
    _fontTypefacesCache.clear();
}
开发者ID:Svyatoslavik,项目名称:OsmAnd-core,代码行数:8,代码来源:TextRasterizer_P.cpp

示例13: scopedLocker

void OsmAnd::OnlineRasterMapLayerProvider::setLocalCachePath(
    const QString& localCachePath,
    const bool appendPathSuffix /*= true*/)
{
    QMutexLocker scopedLocker(&_p->_localCachePathMutex);
    _p->_localCachePath = appendPathSuffix
        ? QDir(localCachePath).absoluteFilePath(pathSuffix)
        : localCachePath;
}
开发者ID:brainbeanapps,项目名称:OsmAnd-core,代码行数:9,代码来源:OnlineRasterMapLayerProvider.cpp

示例14: scopedLocker

std::shared_ptr<const OsmAnd::MapStyle> OsmAnd::MapStylesCollection_P::getAsIsStyle(const QString& name) const
{
    QReadLocker scopedLocker(&_stylesLock);

    const auto citStyle = _styles.constFind(name);
    if (citStyle == _styles.cend())
        return nullptr;
    return *citStyle;
}
开发者ID:kendzi,项目名称:OsmAnd-core,代码行数:9,代码来源:MapStylesCollection_P.cpp

示例15: scopedLocker

OsmAnd::MapRasterizer_P::~MapRasterizer_P()
{
    {
        QMutexLocker scopedLocker(&_pathEffectsMutex);

        for (auto& pathEffect : _pathEffects)
            pathEffect->unref();
    }
}
开发者ID:biddyweb,项目名称:OsmAnd-core,代码行数:9,代码来源:MapRasterizer_P.cpp


注:本文中的scopedLocker函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。