本文整理汇总了C++中ExtentMap::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ ExtentMap::begin方法的具体用法?C++ ExtentMap::begin怎么用?C++ ExtentMap::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExtentMap
的用法示例。
在下文中一共展示了ExtentMap::begin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
/** Write just the specified regions back to the file */
void
SgAsmGenericSection::unparse(std::ostream &f, const ExtentMap &map) const
{
for (ExtentMap::const_iterator i=map.begin(); i!=map.end(); ++i) {
Extent e = i->first;
assert(e.first()+e.size() <= get_size());
const unsigned char *extent_data;
if (e.first() >= p_data.size()) {
extent_data = NULL;
} else if (e.first() + e.size() > p_data.size()) {
extent_data = &p_data[e.first()];
} else {
extent_data = &p_data[e.first()];
}
if (extent_data)
write(f, e.first(), e.size(), extent_data);
}
}
示例2: hp
//.........这里部分代码省略.........
fprintf(stderr, "%s -- %s --\n",
p, 0==pass?"FIRST PASS":"SECOND PASS (after making a larger hole)");
}
/* S offset and size in file or memory address space */
if (filespace) {
sp = s->get_file_extent();
} else if (!memspace || !s->is_mapped()) {
return; /*nothing to do*/
} else {
sp = s->get_mapped_preferred_extent();
}
/* Build address map */
for (size_t i=0; i<all.size(); i++) {
if (filespace) {
amap.insert(all[i]->get_file_extent());
} else {
ROSE_ASSERT(all[i]->is_mapped());
amap.insert(all[i]->get_mapped_preferred_extent());
}
}
if (debug) {
fprintf(stderr, "%s Address map:\n", p);
amap.dump_extents(stderr, (std::string(p)+" ").c_str(), "amap");
fprintf(stderr, "%s Extent of S:\n", p);
fprintf(stderr, "%s start=0x%08" PRIx64 " size=0x%08" PRIx64 " end=0x%08" PRIx64 "\n",
p, sp.relaxed_first(), sp.size(), sp.relaxed_first()+sp.size());
}
/* Neighborhood (nhs) of S is a single extent. However, if S is zero size then nhs might be empty. The neighborhood of
* S is S plus all sections that overlap with S and all sections that are right-contiguous with S. */
ExtentMap nhs_map;
for (ExtentMap::iterator amapi=amap.begin(); amapi!=amap.end(); ++amapi) {
if (amapi->first.relaxed_first() <= sp.relaxed_first()+sp.size() &&
amapi->first.relaxed_first()+amapi->first.size() > sp.relaxed_first())
nhs_map.insert(amapi->first, amapi->second);
}
if (debug) {
fprintf(stderr, "%s Neighborhood of S:\n", p);
nhs_map.dump_extents(stderr, (std::string(p)+" ").c_str(), "nhs_map");
}
Extent nhs;
if (nhs_map.size()>0) {
assert(nhs_map.nranges()==1);
nhs = nhs_map.begin()->first;
} else {
nhs = sp;
}
/* What sections are in the neighborhood (including S), and right of the neighborhood? */
neighbors.clear(); /*sections in neighborhood*/
neighbors.push_back(s);
villagers.clear(); /*sections right of neighborhood*/
if (debug)
fprintf(stderr, "%s Ignoring left (L) sections:\n", p);
for (size_t i=0; i<all.size(); i++) {
SgAsmGenericSection *a = all[i];
if (a==s) continue; /*already pushed onto neighbors*/
Extent ap;
if (filespace) {
ap = a->get_file_extent();
} else if (!a->is_mapped()) {
continue;
} else {
ap = a->get_mapped_preferred_extent();
示例3: toAddressIntervalSet
AddressIntervalSet toAddressIntervalSet(const ExtentMap &x) {
AddressIntervalSet retval;
for (ExtentMap::const_iterator iter=x.begin(); iter!=x.end(); ++iter)
retval.insert(toAddressInterval(iter->first));
return retval;
}