本文整理汇总了C++中configset::const_iterator::getIfSet方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::getIfSet方法的具体用法?C++ const_iterator::getIfSet怎么用?C++ const_iterator::getIfSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类configset::const_iterator
的用法示例。
在下文中一共展示了const_iterator::getIfSet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
}
}
示例2: CoverageValuePredicate
void
SplatCoverageLegend::fromConfig(const Config& conf)
{
conf.getIfSet("name", _name);
conf.getIfSet("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->getIfSet( "name", p->_description );
i->getIfSet( "value", p->_exactValue );
i->getIfSet( "class", p->_mappedClassName );
if ( p->_mappedClassName.isSet() )
{
_predicates.push_back( p.get() );
}
}
}