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


C++ configset::const_iterator类代码示例

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


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

示例1: TileMapEntry

bool
TileMapServiceReader::read( const Config& conf, TileMapEntryList& tileMaps)
{    
    const Config* TileMapServiceConf = conf.find("tilemapservice");

    if (!TileMapServiceConf)
    {
        OE_NOTICE << "Couldn't find root TileMapService element" << std::endl;
        return false;
    }

    const Config* TileMapsConf = TileMapServiceConf->find("tilemaps");
    if (TileMapsConf)
    {
        const ConfigSet& TileMaps = TileMapsConf->children("tilemap");
        if (TileMaps.size() == 0)
        {            
            return false;
        }
        
        for (ConfigSet::const_iterator itr = TileMaps.begin(); itr != TileMaps.end(); ++itr)
        {
            std::string href = itr->value("href");
            std::string title = itr->value("title");
            std::string profile = itr->value("profile");
            std::string srs = itr->value("srs");            

            tileMaps.push_back( TileMapEntry( title, href, srs, profile ) );
        }        

        return true;
    }    
    return false;
}
开发者ID:Arlockff,项目名称:osgearth,代码行数:34,代码来源:TMS.cpp

示例2: Region

Biome::Biome(const Config& conf)
{
    conf.getIfSet( "name", _name );
    conf.getIfSet( "catalog", _catalogURI );
    
    // only supports lat long for now
    const SpatialReference* srs = SpatialReference::create("wgs84");
    
    const Config& extentsConf = conf.child("regions");
    for(ConfigSet::const_iterator i = extentsConf.children().begin();
        i != extentsConf.children().end();
        ++i)
    {
        double xmin = i->value("xmin", -DBL_MAX);
        double xmax = i->value("xmax",  DBL_MAX);
        double ymin = i->value("ymin", -DBL_MAX);
        double ymax = i->value("ymax",  DBL_MAX);
        double zmin = i->value("zmin", -DBL_MAX);
        double zmax = i->value("zmax",  DBL_MAX);
        
        _regions.push_back( Region() );
        _regions.back().extent = GeoExtent(srs, xmin, ymin, xmax, ymax);
        _regions.back().zmin  = zmin;
        _regions.back().zmax  = zmax;
    }
}
开发者ID:Brucezhou1979,项目名称:osgearth,代码行数:26,代码来源:Biome.cpp

示例3: URIContext

void
KML_Model::parseStyle(const Config& conf, KMLContext& cx, Style& style)
{    
    ModelSymbol* model = 0L;
    
    std::string url = KMLUtils::parseLink(conf);
    if ( !url.empty() )
    {
        if ( !model ) model = style.getOrCreate<ModelSymbol>();
        model->url()->setLiteral( url );
        model->url()->setURIContext( URIContext(conf.referrer()) );
    }

    Config scale = conf.child("scale");
    if (!scale.empty())
    {
        if ( !model ) model = style.getOrCreate<ModelSymbol>();
        //TODO:  Support XYZ scale instead of single value
        model->scale() = scale.value("x", 1.0);
    }

    Config orientation = conf.child("orientation");
    if (!orientation.empty())
    {
        if ( !model ) model = style.getOrCreate<ModelSymbol>();
        
        double h = orientation.value("heading", 0);
        if ( !osg::equivalent(h, 0.0) )
            model->heading() = NumericExpression( h );

        double p = orientation.value("tilt", 0);
        if ( !osg::equivalent(p, 0.0) )
            model->pitch() = NumericExpression( p );

        double r = orientation.value("roll", 0);
        if ( !osg::equivalent(r, 0.0) )
            model->roll() = NumericExpression( r );
    }

    // Read and store file path aliases from a KML ResourceMap.
    Config resource_map = conf.child("resourcemap");
    if ( !resource_map.empty() )
    {
        const ConfigSet aliases = resource_map.children("alias");
        for( ConfigSet::const_iterator i = aliases.begin(); i != aliases.end(); ++i )
        {
            std::string source = i->value("sourcehref");
            std::string target = i->value("targethref");
            if ( !source.empty() || !target.empty() )
            {
                if ( !model ) model = style.getOrCreate<ModelSymbol>();
                model->uriAliasMap()->insert( source, target );
            }
        }
    }

    KML_Geometry::parseStyle(conf, cx, style);
}
开发者ID:JohnDr,项目名称:osgearth,代码行数:58,代码来源:KML_Model.cpp

示例4: GetConfig

const EglConfigImpl* EglDisplayImpl::GetConfig(EGLConfig cfg) const {
  for (ConfigSet::const_iterator i = configs_.begin(); i != configs_.end();
       ++i) {
    if (i->GetKey() == cfg) {
      return &*i;
    }
  }
  return NULL;
}
开发者ID:epowers,项目名称:arc,代码行数:9,代码来源:egl_display_impl.cpp

示例5: emptyConfig

const Config&
Config::child( const std::string& childName ) const
{
    for( ConfigSet::const_iterator i = _children.begin(); i != _children.end(); i++ ) {
        if ( i->key() == childName )
            return *i;
    }
    return emptyConfig();
}
开发者ID:lozpeng,项目名称:applesales,代码行数:9,代码来源:Config.cpp

示例6:

const Config*
Config::child_ptr( const std::string& childName ) const
{
    for( ConfigSet::const_iterator i = _children.begin(); i != _children.end(); i++ ) {
        if ( i->key() == childName )
            return &(*i);
    }
    return 0L;
}
开发者ID:JohnDr,项目名称:osgearth,代码行数:9,代码来源:Config.cpp

示例7: IsValidConfig

bool EglDisplayImpl::IsValidConfig(EGLConfig config) const {
  for (ConfigSet::const_iterator i = configs_.begin(); i != configs_.end();
       ++i) {
    if (config == i->GetKey()) {
      return true;
    }
  }
  return false;
}
开发者ID:epowers,项目名称:arc,代码行数:9,代码来源:egl_display_impl.cpp

示例8: uri

void
ShaderOptions::fromConfig(const Config& conf)
{
    _code = conf.value();

    _samplers.clear();
    ConfigSet s = conf.children("sampler");
    for (ConfigSet::const_iterator i = s.begin(); i != s.end(); ++i) {
        _samplers.push_back(Sampler());
        _samplers.back()._name = i->value("name");
        const Config* urlarray = i->find("array");
        if (urlarray) {
            ConfigSet uris = urlarray->children("url");
            for (ConfigSet::const_iterator j = uris.begin(); j != uris.end(); ++j) {
                URI uri(j->value(), URIContext(conf.referrer()));
                _samplers.back()._uris.push_back(uri);
            }
        }
        else {
            optional<URI> uri;
            i->get("url", uri);
            if (uri.isSet())
                _samplers.back()._uris.push_back(uri.get());
        }
    }

    s = conf.children("uniform");
    for (ConfigSet::const_iterator i = s.begin(); i != s.end(); ++i) {
        _uniforms.push_back(Uniform());
        _uniforms.back()._name = i->value("name");
        i->get("value", _uniforms.back()._value);
    }
}
开发者ID:aroth-fastprotect,项目名称:osgearth,代码行数:33,代码来源:LayerShader.cpp

示例9: remove

void
Config::merge( const Config& rhs ) 
{
    // remove any matching keys first; this will allow the addition of multi-key values
    for( ConfigSet::const_iterator c = rhs._children.begin(); c != rhs._children.end(); ++c )
        remove( c->key() );

    // add in the new values.
    for( ConfigSet::const_iterator c = rhs._children.begin(); c != rhs._children.end(); ++c )
        add( *c );
}
开发者ID:JohnDr,项目名称:osgearth,代码行数:11,代码来源:Config.cpp

示例10: e

TerrainLayer::CacheBinMetadata::CacheBinMetadata(const Config& conf)
{
    _valid = !conf.empty();

    conf.getIfSet("cachebin_id", _cacheBinId);
    conf.getIfSet("source_name", _sourceName);
    conf.getIfSet("source_driver", _sourceDriver);
    conf.getIfSet("source_tile_size", _sourceTileSize);
    conf.getObjIfSet("source_profile", _sourceProfile);
    conf.getObjIfSet("cache_profile", _cacheProfile);
    conf.getIfSet("cache_create_time", _cacheCreateTime);

    const Config* extentsRoot = conf.child_ptr("extents");
    if ( extentsRoot )
    {
        const ConfigSet& extents = extentsRoot->children();

        for (ConfigSet::const_iterator i = extents.begin(); i != extents.end(); ++i)
        {
            std::string srsString;
            double xmin, ymin, xmax, ymax;
            optional<unsigned> minLevel, maxLevel;
        
            srsString = i->value("srs");
            xmin = i->value("xmin", 0.0f);
            ymin = i->value("ymin", 0.0f);
            xmax = i->value("xmax", 0.0f);
            ymax = i->value("ymax", 0.0f);
            i->getIfSet("minlevel", minLevel);
            i->getIfSet("maxlevel", maxLevel);

            const SpatialReference* srs = SpatialReference::get(srsString);
            DataExtent e( GeoExtent(srs, xmin,  ymin, xmax, ymax) );
            if (minLevel.isSet())
                e.minLevel() = minLevel.get();
            if (maxLevel.isSet())
                e.maxLevel() = maxLevel.get();

            _dataExtents.push_back(e);
        }
    }

    // check for validity. This will reject older caches that don't have
    // sufficient attribution.
    if (_valid)
    {
        if (!conf.hasValue("source_tile_size") ||
            !conf.hasChild("source_profile") ||
            !conf.hasChild("cache_profile"))
        {
            _valid = false;
        }
    }
}
开发者ID:caishanli,项目名称:osgearth,代码行数:54,代码来源:TerrainLayer.cpp

示例11: result

Config
Config::operator - ( const Config& rhs ) const
{
    Config result( *this );

    for( ConfigSet::const_iterator i = rhs.children().begin(); i != rhs.children().end(); ++i )
    {
        result.remove( i->key() );
    }

    return result;
}
开发者ID:JohnDr,项目名称:osgearth,代码行数:12,代码来源:Config.cpp

示例12: XmlElement

XmlElement::XmlElement( const Config& conf )
{
    name = conf.key();
    for( Properties::const_iterator i = conf.attrs().begin(); i != conf.attrs().end(); i++ )
        attrs[i->first] = i->second;
    for( ConfigSet::const_iterator j = conf.children().begin(); j != conf.children().end(); j++ )
    {
        if (!j->children().empty())
        {
            children.push_back( new XmlElement( *j ) );
        }
        else
        {
            addSubElement(j->key(), j->attrs(), j->value());
        }
    }
}
开发者ID:jehc,项目名称:osgearth,代码行数:17,代码来源:XmlUtils.cpp

示例13: end

void ChromeMetricsBackend::end(const std::string& name, const Config& args)
{
    osg::Timer_t now = osg::Timer::instance()->tick();

    OpenThreads::ScopedLock< OpenThreads::Mutex > lk(_mutex);
    if (_firstEvent)
    {
        _firstEvent = false;
    }
    else
    {
        _metricsFile << "," << std::endl;
    }
    _metricsFile << "{"
        << "\"cat\": \"" << "" << "\","
        << "\"pid\": \"" << 0 << "\","
        << "\"tid\": \"" << osgEarth::Threading::getCurrentThreadId() << "\","
        << "\"ts\": \""  << std::setprecision(9) << osg::Timer::instance()->delta_u(_startTime, now) << "\","
        << "\"ph\": \"E\","
        << "\"name\": \""  << name << "\"";

    if (!args.empty())
    {
        _metricsFile << "," << std::endl << " \"args\": {";
        bool first = true;
        for( ConfigSet::const_iterator i = args.children().begin(); i != args.children().end(); ++i ) {
            if (first)
            {
                first = !first;
            }
            else
            {
                _metricsFile << "," << std::endl;
            }
            _metricsFile << "\"" << i->key() << "\" : \"" << i->value() << "\"";
        }
        _metricsFile << "}";
    }

    _metricsFile << "}";
}
开发者ID:JD31,项目名称:osgearth,代码行数:41,代码来源:Metrics.cpp

示例14: CoverageValuePredicate

void
SplatCoverageLegend::fromConfig(const Config& conf)
{
    conf.get("name",   _name);
    conf.get("source", _source);

    ConfigSet predicatesConf = conf.child("mappings").children();
    for(ConfigSet::const_iterator i = predicatesConf.begin(); i != predicatesConf.end(); ++i)
    {
        osg::ref_ptr<CoverageValuePredicate> p = new CoverageValuePredicate();

        i->get( "name",  p->_description );
        i->get( "value", p->_exactValue );
        i->get( "class", p->_mappedClassName );
        
        if ( p->_mappedClassName.isSet() )
        {
            _predicates.push_back( p.get() );
        }
    }
}
开发者ID:emminizer,项目名称:osgearth,代码行数:21,代码来源:SplatCoverageLegend.cpp

示例15: if

XmlElement::XmlElement( const Config& conf )
{
    name = conf.key();

    if ( !conf.value().empty() )
    {
        children.push_back( new XmlText(conf.value()) );
    }

    for( ConfigSet::const_iterator j = conf.children().begin(); j != conf.children().end(); j++ )
    {
        if ( j->isSimple() )
        {
            attrs[j->key()] = j->value();
        }
        else if ( j->children().size() > 0 )
        {
            children.push_back( new XmlElement(*j) );
        }
    }
}
开发者ID:JohnDr,项目名称:osgearth,代码行数:21,代码来源:XmlUtils.cpp


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