本文整理汇总了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;
}
示例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;
}
}
示例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);
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
}
示例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 );
}
示例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;
}
}
}
示例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;
}
示例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());
}
}
}
示例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 << "}";
}
示例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() );
}
}
}
示例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) );
}
}
}