本文整理汇总了C++中Ref::GetReflectionInfoV方法的典型用法代码示例。如果您正苦于以下问题:C++ Ref::GetReflectionInfoV方法的具体用法?C++ Ref::GetReflectionInfoV怎么用?C++ Ref::GetReflectionInfoV使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ref
的用法示例。
在下文中一共展示了Ref::GetReflectionInfoV方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadRef
// ReadRef
//------------------------------------------------------------------------------
bool TextReader::ReadRef()
{
// Name
AStackString<> name;
if ( !GetToken( name ) )
{
Error( "Missing ref name" );
return false;
}
AStackString<> value;
if ( !GetString( value ) )
{
Error( "Missing ref value" );
return false;
}
Ref< RefObject > ref;
if ( value != "null" )
{
ref = (RefObject *)ReflectionInfo::CreateObject( value );
if ( ref.Get() == nullptr )
{
Error( "Unable to create sub-object" );
ASSERT( false ); // TODO: Handle failure/skipping gracefully
return false;
}
}
const StackFrame & sf = m_DeserializationStack.Top();
if ( sf.m_ArrayProperty )
{
void * arrayBase = (void *)( (size_t)sf.m_Base + (size_t)sf.m_ArrayProperty->GetOffset() );
Array< Ref< RefObject > > *array = ( Array< Ref< RefObject > > *)( arrayBase );
array->Append( ref );
}
else
{
sf.m_Reflection->SetProperty( sf.m_Base, name.Get(), ref );
}
// do sub-object properties if needed
if ( ref.Get() )
{
StackFrame newFrame;
newFrame.m_Base = (void *)ref.Get();
newFrame.m_Reflection = ref->GetReflectionInfoV();
newFrame.m_ArrayProperty = nullptr;
#ifdef DEBUG
newFrame.m_RefObject = ref.Get();
newFrame.m_Struct = nullptr;
#endif
m_DeserializationStack.Append( newFrame );
}
return true;
}