本文整理汇总了C++中NameCollection::load方法的典型用法代码示例。如果您正苦于以下问题:C++ NameCollection::load方法的具体用法?C++ NameCollection::load怎么用?C++ NameCollection::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NameCollection
的用法示例。
在下文中一共展示了NameCollection::load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
MapModuleNoticeContainer::loadMapSupCoverage( DataBuffer* db ){
MC2_ASSERT(db != NULL);
// Read number of elements
uint32 nbrElements = db->readNextLong();
for (uint32 i=0; i<nbrElements; i++){
// Read bounding box
uint32 maxLat = db->readNextLong();
uint32 minLat = db->readNextLong();
uint32 maxLon = db->readNextLong();
uint32 minLon = db->readNextLong();
MC2BoundingBox bBox;
bBox.setMaxLat(maxLat);
bBox.setMinLat(minLat);
bBox.setMaxLon(maxLon);
bBox.setMinLon(minLon);
// Read supplier name.
MapGenEnums::mapSupplier mapSupplier =
static_cast<MapGenEnums::mapSupplier>(db->readNextLong());
m_mapSupCoverage.push_back(make_pair(bBox, mapSupplier));
}
mc2dbg << "[MMNC]: Loaded " << m_mapSupCoverage.size()
<< " map supplier coverage bounding boxes." << endl;
// Read coverage tree.
nbrElements = db->readNextLong();
m_mapSupCoverageTree.reserve(nbrElements);
for (uint32 i=0; i<nbrElements; i++){
uint32 parent = db->readNextLong();
uint32 child = db->readNextLong();
m_mapSupCoverageTree.push_back(make_pair(parent, child));
}
MC2_ASSERT(m_mapSupCoverageTree.size() == nbrElements);
// Load map supplier names.
uint32 nbrToRead = db->readNextLong();
for (uint32 i=0; i<nbrToRead; i++){
NameCollection tmpNames;
MapGenEnums::mapSupplier mapSup =
static_cast<MapGenEnums::mapSupplier>(db->readNextLong());
tmpNames.load(db);
m_mapSupNamesByMapSup.insert(make_pair(mapSup, tmpNames));
}
mc2dbg << "[MMNC]: Loaded " << m_mapSupNamesByMapSup.size()
<< " map supplier names." << endl;
} // MapModuleNoticeContainer::loadMapSupCoverage