本文整理汇总了C++中Reference::SetTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Reference::SetTo方法的具体用法?C++ Reference::SetTo怎么用?C++ Reference::SetTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reference
的用法示例。
在下文中一共展示了Reference::SetTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inputInterface
status_t
DwarfImageDebugInfo::GetType(GlobalTypeCache* cache,
const BString& name, Type*& _type)
{
int32 registerCount = fArchitecture->CountRegisters();
const Register* registers = fArchitecture->Registers();
// get the DWARF -> architecture register map
RegisterMap* fromDwarfMap;
status_t error = fArchitecture->GetDwarfRegisterMaps(NULL, &fromDwarfMap);
if (error != B_OK)
return error;
Reference<RegisterMap> fromDwarfMapReference(fromDwarfMap, true);
// create the target interface
BasicTargetInterface inputInterface(registers, registerCount, fromDwarfMap,
fArchitecture, fTeamMemory);
// iterate through all compilation units
for (int32 i = 0; CompilationUnit* unit = fFile->CompilationUnitAt(i);
i++) {
DwarfTypeContext* typeContext = NULL;
Reference<DwarfTypeContext> typeContextReference;
// iterate through all types of the compilation unit
for (DebugInfoEntryList::ConstIterator it
= unit->UnitEntry()->Types().GetIterator();
DIEType* typeEntry = dynamic_cast<DIEType*>(it.Next());) {
if (typeEntry->IsDeclaration())
continue;
BString typeEntryName;
DwarfUtils::GetFullyQualifiedDIEName(typeEntry, typeEntryName);
if (typeEntryName != name)
continue;
// The name matches and the entry is not just a declaration --
// create the type. First create the type context lazily.
if (typeContext == NULL) {
typeContext = new(std::nothrow)
DwarfTypeContext(fArchitecture, fImageInfo.ImageID(), fFile,
unit, NULL, 0, 0, &inputInterface, fromDwarfMap);
if (typeContext == NULL)
return B_NO_MEMORY;
typeContextReference.SetTo(typeContext, true);
}
// create the type
DwarfType* type;
DwarfTypeFactory typeFactory(typeContext, fTypeLookup, cache);
error = typeFactory.CreateType(typeEntry, type);
if (error != B_OK)
continue;
_type = type;
return B_OK;
}
}
return B_ENTRY_NOT_FOUND;
}