本文整理汇总了C++中ValueObject类的典型用法代码示例。如果您正苦于以下问题:C++ ValueObject类的具体用法?C++ ValueObject怎么用?C++ ValueObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ValueObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getValue
bool CornerNode::getValue (const String& strMemberName, String& strValue)
{
bool bValueSet = false;
Corner* pObject = dynamic_cast<Corner*>(m_pObject);
if (strMemberName == L"value")
{
ValueObject* pValueObj = dynamic_cast<ValueObject*>(m_pObject);
if (pValueObj)
{
if (!pValueObj->isNothing())
{
strValue = pValueObj->toString();
bValueSet = true;
}
}
}
else if (strMemberName == L"StaStart")
{
if (pObject->hasValue_StaStart())
{
strValue = (DoubleObjectImpl(pObject->getStaStart())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"StaEnd")
{
if (pObject->hasValue_StaEnd())
{
strValue = (DoubleObjectImpl(pObject->getStaEnd())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"Type")
{
if (pObject->hasValue_Type())
{
strValue = (EnumCornerTypeImpl(pObject->getType())).toString();
bValueSet = true;
}
}
return bValueSet;
}
示例2: getValue
bool DesignHourNode::getValue (const String& strMemberName, String& strValue)
{
bool bValueSet = false;
DesignHour* pObject = dynamic_cast<DesignHour*>(m_pObject);
if (strMemberName == L"value")
{
ValueObject* pValueObj = dynamic_cast<ValueObject*>(m_pObject);
if (pValueObj)
{
if (!pValueObj->isNothing())
{
strValue = pValueObj->toString();
bValueSet = true;
}
}
}
else if (strMemberName == L"StaStart")
{
if (pObject->hasValue_StaStart())
{
strValue = (DoubleObjectImpl(pObject->getStaStart())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"StaEnd")
{
if (pObject->hasValue_StaEnd())
{
strValue = (DoubleObjectImpl(pObject->getStaEnd())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"Volume")
{
if (pObject->hasValue_Volume())
{
strValue = (DoubleObjectImpl(pObject->getVolume())).toString();
bValueSet = true;
}
}
return bValueSet;
}
示例3: getValue
bool OffsetValsNode::getValue (const String& strMemberName, String& strValue)
{
bool bValueSet = false;
OffsetVals* pObject = dynamic_cast<OffsetVals*>(m_pObject);
if (strMemberName == L"value")
{
ValueObject* pValueObj = dynamic_cast<ValueObject*>(m_pObject);
if (pValueObj)
{
if (!pValueObj->isNothing())
{
strValue = pValueObj->toString();
bValueSet = true;
}
}
}
else if (strMemberName == L"OffsetInOut")
{
if (pObject->hasValue_OffsetInOut())
{
strValue = (DoubleObjectImpl(pObject->getOffsetInOut())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"OffsetLeftRight")
{
if (pObject->hasValue_OffsetLeftRight())
{
strValue = (DoubleObjectImpl(pObject->getOffsetLeftRight())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"OffsetUpDown")
{
if (pObject->hasValue_OffsetUpDown())
{
strValue = (DoubleObjectImpl(pObject->getOffsetUpDown())).toString();
bValueSet = true;
}
}
return bValueSet;
}
示例4: getValue
bool NoPassingZoneNode::getValue (const String& strMemberName, String& strValue)
{
bool bValueSet = false;
NoPassingZone* pObject = dynamic_cast<NoPassingZone*>(m_pObject);
if (strMemberName == L"value")
{
ValueObject* pValueObj = dynamic_cast<ValueObject*>(m_pObject);
if (pValueObj)
{
if (!pValueObj->isNothing())
{
strValue = pValueObj->toString();
bValueSet = true;
}
}
}
else if (strMemberName == L"StaStart")
{
if (pObject->hasValue_StaStart())
{
strValue = (DoubleObjectImpl(pObject->getStaStart())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"StaEnd")
{
if (pObject->hasValue_StaEnd())
{
strValue = (DoubleObjectImpl(pObject->getStaEnd())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"SideofRoad")
{
if (pObject->hasValue_SideofRoad())
{
strValue = (EnumSideofRoadTypeImpl(pObject->getSideofRoad())).toString();
bValueSet = true;
}
}
return bValueSet;
}
示例5: getValue
bool CrossSectSurfNode::getValue (const String& strMemberName, String& strValue)
{
bool bValueSet = false;
CrossSectSurf* pObject = dynamic_cast<CrossSectSurf*>(m_pObject);
if (strMemberName == L"value")
{
ValueObject* pValueObj = dynamic_cast<ValueObject*>(m_pObject);
if (pValueObj)
{
if (!pValueObj->isNothing())
{
strValue = pValueObj->toString();
bValueSet = true;
}
}
}
else if (strMemberName == L"Name")
{
if (pObject->hasValue_Name())
{
strValue = (StringObjectImpl(pObject->getName())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"Desc")
{
if (pObject->hasValue_Desc())
{
strValue = (StringObjectImpl(pObject->getDesc())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"State")
{
if (pObject->hasValue_State())
{
strValue = (EnumStateTypeImpl(pObject->getState())).toString();
bValueSet = true;
}
}
return bValueSet;
}
示例6: compiler_type
bool
AppleObjCRuntime::GetObjectDescription (Stream &str, ValueObject &valobj)
{
CompilerType compiler_type(valobj.GetCompilerType());
bool is_signed;
// ObjC objects can only be pointers (or numbers that actually represents pointers
// but haven't been typecast, because reasons..)
if (!compiler_type.IsIntegerType (is_signed) && !compiler_type.IsPointerType ())
return false;
// Make the argument list: we pass one arg, the address of our pointer, to the print function.
Value val;
if (!valobj.ResolveValue(val.GetScalar()))
return false;
ExecutionContext exe_ctx (valobj.GetExecutionContextRef());
return GetObjectDescription(str, val, exe_ctx.GetBestExecutionContextScope());
}
示例7: exe_ctx
bool
AppleObjCRuntime::GetObjectDescription (Stream &str, ValueObject &valobj)
{
bool is_signed;
// ObjC objects can only be pointers, but we extend this to integer types because an expression might just
// result in an address, and we should try that to see if the address is an ObjC object.
if (!(valobj.IsPointerType() || valobj.IsIntegerType(is_signed)))
return false;
// Make the argument list: we pass one arg, the address of our pointer, to the print function.
Value val;
if (!valobj.ResolveValue(val.GetScalar()))
return false;
ExecutionContext exe_ctx (valobj.GetExecutionContextRef());
return GetObjectDescription(str, val, exe_ctx.GetBestExecutionContextScope());
}
示例8: ValueObject
ValueObjectSynthetic::ValueObjectSynthetic (ValueObject &parent, lldb::SyntheticChildrenSP filter) :
ValueObject(parent),
m_synth_sp(filter),
m_children_byindex(),
m_name_toindex(),
m_synthetic_children_count(UINT32_MAX),
m_parent_type_name(parent.GetTypeName()),
m_might_have_children(eLazyBoolCalculate),
m_provides_value(eLazyBoolCalculate)
{
#ifdef FOOBAR
std::string new_name(parent.GetName().AsCString());
new_name += "$$__synth__";
SetName (ConstString(new_name.c_str()));
#else
SetName(parent.GetName());
#endif
CopyValueData(m_parent);
CreateSynthFilter();
}
示例9: decode_value
bool decode_value(Buffer& buf, ValueObject& value, bool copyRawValue)
{
value.Clear();
if (!BufferHelper::ReadFixUInt8(buf, value.type))
{
return false;
}
switch (value.type)
{
case EMPTY:
{
break;
}
case INTEGER:
{
if (!BufferHelper::ReadVarInt64(buf, value.v.int_v))
{
return false;
}
break;
}
case DOUBLE:
{
if (!BufferHelper::ReadFixDouble(buf, value.v.double_v))
{
return false;
}
break;
}
default:
{
uint32_t len;
if (!BufferHelper::ReadVarUInt32(buf, len)
|| buf.ReadableBytes() < len)
{
return false;
}
if (copyRawValue)
{
value.v.raw = new Buffer(len);
buf.Read(value.v.raw, len);
}
else
{
const char* tmp = buf.GetRawReadBuffer();
value.v.raw = new Buffer(const_cast<char*>(tmp), 0, len);
buf.SkipBytes(len);
}
break;
}
}
return true;
}
示例10:
bool
lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options)
{
if (const char* description = valobj.GetObjectDescription())
{
stream.Printf("%s", description);
return true;
}
else
return false;
}
示例11: ConstString
ConstString
FormatManager::GetTypeForCache (ValueObject& valobj,
lldb::DynamicValueType use_dynamic)
{
ValueObjectSP valobj_sp = valobj.GetQualifiedRepresentationIfAvailable(use_dynamic, valobj.IsSynthetic());
if (valobj_sp && valobj_sp->GetCompilerType().IsValid())
{
if (!valobj_sp->GetCompilerType().IsMeaninglessWithoutDynamicResolution())
return valobj_sp->GetQualifiedTypeName();
}
return ConstString();
}
示例12: g_StringCoreType
bool
lldb_private::formatters::swift::NSContiguousString_SummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options)
{
static ConstString g_StringCoreType("_TtVs11_StringCore");
lldb::addr_t core_location = valobj.GetValueAsUnsigned(LLDB_INVALID_ADDRESS);
if (core_location == LLDB_INVALID_ADDRESS)
return false;
ProcessSP process_sp(valobj.GetProcessSP());
if (!process_sp)
return false;
size_t ptr_size = process_sp->GetAddressByteSize();
core_location += 2*ptr_size;
Error error;
InferiorSizedWord isw_1(process_sp->ReadPointerFromMemory(core_location, error),*process_sp);
InferiorSizedWord isw_2(process_sp->ReadPointerFromMemory(core_location+ptr_size, error),*process_sp);
InferiorSizedWord isw_3(process_sp->ReadPointerFromMemory(core_location+ptr_size+ptr_size, error),*process_sp);
DataBufferSP buffer_sp(new DataBufferHeap(3*ptr_size, 0));
uint8_t* buffer = buffer_sp->GetBytes();
buffer = isw_1.CopyToBuffer(buffer);
buffer = isw_2.CopyToBuffer(buffer);
buffer = isw_3.CopyToBuffer(buffer);
DataExtractor data(buffer_sp, process_sp->GetByteOrder(), ptr_size);
SwiftASTContext* lldb_swift_ast = process_sp->GetTarget().GetScratchSwiftASTContext(error);
if (!lldb_swift_ast)
return false;
CompilerType string_core_type = lldb_swift_ast->GetTypeFromMangledTypename(g_StringCoreType.GetCString(), error);
if (string_core_type.IsValid() == false)
return false;
ValueObjectSP string_core_sp = ValueObject::CreateValueObjectFromData("stringcore", data, valobj.GetExecutionContextRef(), string_core_type);
if (string_core_sp)
return StringCore_SummaryProvider(*string_core_sp, stream, options);
return false;
}
示例13: process_sp
bool
lldb_private::formatters::NSError_SummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options)
{
ProcessSP process_sp(valobj.GetProcessSP());
if (!process_sp)
return false;
lldb::addr_t ptr_value = LLDB_INVALID_ADDRESS;
CompilerType valobj_type(valobj.GetCompilerType());
Flags type_flags(valobj_type.GetTypeInfo());
if (type_flags.AllClear(eTypeHasValue))
{
if (valobj.IsBaseClass() && valobj.GetParent())
ptr_value = valobj.GetParent()->GetValueAsUnsigned(LLDB_INVALID_ADDRESS);
}
else
ptr_value = valobj.GetValueAsUnsigned(LLDB_INVALID_ADDRESS);
if (ptr_value == LLDB_INVALID_ADDRESS)
return false;
size_t ptr_size = process_sp->GetAddressByteSize();
lldb::addr_t code_location = ptr_value + 2 * ptr_size;
lldb::addr_t domain_location = ptr_value + 3 * ptr_size;
Error error;
uint64_t code = process_sp->ReadUnsignedIntegerFromMemory(code_location, ptr_size, 0, error);
if (error.Fail())
return false;
lldb::addr_t domain_str_value = process_sp->ReadPointerFromMemory(domain_location, error);
if (error.Fail() || domain_str_value == LLDB_INVALID_ADDRESS)
return false;
if (!domain_str_value)
{
stream.Printf("domain: nil - code: %" PRIu64, code);
return true;
}
InferiorSizedWord isw(domain_str_value, *process_sp);
ValueObjectSP domain_str_sp = ValueObject::CreateValueObjectFromData("domain_str", isw.GetAsData(process_sp->GetByteOrder()), valobj.GetExecutionContextRef(), process_sp->GetTarget().GetScratchClangASTContext()->GetBasicType(lldb::eBasicTypeVoid).GetPointerType());
if (!domain_str_sp)
return false;
StreamString domain_str_summary;
if (NSStringSummaryProvider(*domain_str_sp, domain_str_summary, options) && !domain_str_summary.Empty())
{
stream.Printf("domain: %s - code: %" PRIu64, domain_str_summary.GetData(), code);
return true;
}
else
{
stream.Printf("domain: nil - code: %" PRIu64, code);
return true;
}
}
示例14: options
bool
lldb_private::formatters::WCharStringSummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions&)
{
ProcessSP process_sp = valobj.GetProcessSP();
if (!process_sp)
return false;
lldb::addr_t valobj_addr = GetArrayAddressOrPointerValue(valobj);
if (valobj_addr == 0 || valobj_addr == LLDB_INVALID_ADDRESS)
return false;
// Get a wchar_t basic type from the current type system
CompilerType wchar_compiler_type = valobj.GetCompilerType().GetBasicTypeFromAST(lldb::eBasicTypeWChar);
if (!wchar_compiler_type)
return false;
const uint32_t wchar_size = wchar_compiler_type.GetBitSize(nullptr); // Safe to pass NULL for exe_scope here
StringPrinter::ReadStringAndDumpToStreamOptions options(valobj);
options.SetLocation(valobj_addr);
options.SetProcessSP(process_sp);
options.SetStream(&stream);
options.SetPrefixToken("L");
switch (wchar_size)
{
case 8:
return StringPrinter::ReadStringAndDumpToStream<StringPrinter::StringElementType::UTF8>(options);
case 16:
return StringPrinter::ReadStringAndDumpToStream<StringPrinter::StringElementType::UTF16>(options);
case 32:
return StringPrinter::ReadStringAndDumpToStream<StringPrinter::StringElementType::UTF32>(options);
default:
stream.Printf("size for wchar_t is not valid");
return true;
}
return true;
}
示例15: UpdateValueIfNeeded
lldb::ValueObjectSP
ValueObjectSynthetic::GetChildAtIndex (size_t idx, bool can_create)
{
UpdateValueIfNeeded();
ValueObject *valobj;
if (m_children_byindex.GetValueForKey(idx, valobj) == false)
{
if (can_create && m_synth_filter_ap.get() != NULL)
{
lldb::ValueObjectSP synth_guy = m_synth_filter_ap->GetChildAtIndex (idx);
if (!synth_guy)
return synth_guy;
m_children_byindex.SetValueForKey(idx, synth_guy.get());
return synth_guy;
}
else
return lldb::ValueObjectSP();
}
else
return valobj->GetSP();
}