本文整理汇总了C++中ObjectPtr::GetClass方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPtr::GetClass方法的具体用法?C++ ObjectPtr::GetClass怎么用?C++ ObjectPtr::GetClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectPtr
的用法示例。
在下文中一共展示了ObjectPtr::GetClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeserializeInstance
void ArchiveXML::DeserializeInstance(ObjectPtr& object)
{
//
// If we don't have an object allocated for deserialization, pull one from the stream
//
if (!object.ReferencesObject())
{
object = Allocate();
}
//
// We should now have an instance (unless data was skipped)
//
if (object.ReferencesObject())
{
#ifdef REFLECT_ARCHIVE_VERBOSE
m_Indent.Get(stdout);
Log::Print(TXT("Deserializing %s\n"), object->GetClass()->m_Name);
m_Indent.Push();
#endif
object->PreDeserialize( NULL );
Data* data = SafeCast<Data>(object);
if ( data )
{
#pragma TODO("Make sure this string copy goes away when replace the stl stream APIs")
tstring body ( m_Iterator.GetCurrent()->m_Body.GetData(), m_Iterator.GetCurrent()->m_Body.GetSize() );
tstringstream stringStream ( body );
TCharStream stream ( &stringStream, false );
m_Body = &stream;
data->Deserialize(*this);
m_Body = NULL;
m_Iterator.Advance( true );
}
else
{
DeserializeFields(object);
}
object->PostDeserialize( NULL );
#ifdef REFLECT_ARCHIVE_VERBOSE
m_Indent.Pop();
#endif
}
}
示例2: DeserializeInstance
void ArchiveBinary::DeserializeInstance(ObjectPtr& object)
{
//
// If we don't have an object allocated for deserialization, pull one from the stream
//
if (!object.ReferencesObject())
{
object = Allocate();
}
//
// We should now have an instance (unless data was skipped)
//
if (object.ReferencesObject())
{
#ifdef REFLECT_ARCHIVE_VERBOSE
m_Indent.Get(stdout);
Log::Print(TXT("Deserializing %s\n"), object->GetClass()->m_Name);
m_Indent.Push();
#endif
object->PreDeserialize( NULL );
Data* data = SafeCast<Data>(object);
if ( data )
{
data->Deserialize(*this);
}
else
{
DeserializeFields(object);
}
object->PostDeserialize( NULL );
#ifdef REFLECT_ARCHIVE_VERBOSE
m_Indent.Pop();
#endif
}
}