本文整理汇总了C++中PointerSet类的典型用法代码示例。如果您正苦于以下问题:C++ PointerSet类的具体用法?C++ PointerSet怎么用?C++ PointerSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PointerSet类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: markVisited
inline bool DataWalker::markVisited(
HeapObject* ptr,
DataFeature& features,
PointerSet& visited) const {
if (!visited.insert(ptr).second) {
features.isCircular = true;
return true;
}
return false;
}
示例2: f_array_merge_recursive
Variant f_array_merge_recursive(int _argc, CVarRef array1,
CArrRef _argv /* = null_array */) {
getCheckedArray(array1);
Array ret = Array::Create();
PointerSet seen;
php_array_merge_recursive(seen, false, ret, arr_array1);
assert(seen.empty());
for (ArrayIter iter(_argv); iter; ++iter) {
Variant v = iter.second();
if (!v.isArray()) {
throw_bad_array_exception();
return uninit_null();
}
CArrRef arr_v = v.asCArrRef();
php_array_merge_recursive(seen, false, ret, arr_v);
assert(seen.empty());
}
return ret;
}
示例3: hasInternalReference
bool ArrayData::hasInternalReference(PointerSet &vars,
bool ds /* = false */) const {
if (isSharedMap()) return false;
for (ArrayIter iter(this); iter; ++iter) {
CVarRef var = iter.secondRef();
if (var.isReferenced()) {
Variant *pvar = var.getRefData();
if (vars.find(pvar) != vars.end()) {
return true;
}
vars.insert(pvar);
}
if (var.isObject()) {
ObjectData *pobj = var.getObjectData();
if (vars.find(pobj) != vars.end()) {
return true;
}
vars.insert(pobj);
if (ds && pobj->o_instanceof("Serializable")) {
return true;
}
if (pobj->hasInternalReference(vars, ds)) {
return true;
}
} else if (var.isArray() &&
var.getArrayData()->hasInternalReference(vars, ds)) {
return true;
}
}
return false;
}
示例4: hasInternalReference
bool ArrayData::hasInternalReference(PointerSet &vars) const {
if (supportValueRef()) {
for (ArrayIter iter(this); iter; ++iter) {
CVarRef var = iter.secondRef();
if (var.isReferenced()) {
Variant *pvar = var.getVariantData();
if (vars.find(pvar) != vars.end()) {
return true;
}
vars.insert(pvar);
}
if (var.isObject()) {
ObjectData *pobj = var.getObjectData();
if (vars.find(pobj) != vars.end()) {
return true;
}
vars.insert(pobj);
if (pobj->o_toArray().get()->hasInternalReference(vars)) {
return true;
}
} else if (var.isArray() &&
var.getArrayData()->hasInternalReference(vars)) {
return true;
}
}
}
return false;
}
示例5: hasInternalReference
bool ArrayData::hasInternalReference(PointerSet &vars,
bool ds /* = false */) const {
if (isSharedMap()) return false;
for (ArrayIter iter(this); iter; ++iter) {
CVarRef var = iter.secondRef();
if (var.isReferenced()) {
Variant *pvar = var.getVariantData();
if (vars.find(pvar) != vars.end()) {
return true;
}
vars.insert(pvar);
}
if (var.isObject()) {
ObjectData *pobj = var.getObjectData();
if (vars.find(pobj) != vars.end()) {
return true;
}
vars.insert(pobj);
if (pobj->o_instanceof("Serializable")) {
if (ds) {
// We want to detect Serializable object as well
return true;
} else {
// Serializable object does not have internal reference issue
return false;
}
}
if (pobj->o_toArray().get()->hasInternalReference(vars, ds)) {
return true;
}
} else if (var.isArray() &&
var.getArrayData()->hasInternalReference(vars, ds)) {
return true;
}
}
return false;
}