本文整理汇总了C++中UObject::GetInterfaceAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ UObject::GetInterfaceAddress方法的具体用法?C++ UObject::GetInterfaceAddress怎么用?C++ UObject::GetInterfaceAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UObject
的用法示例。
在下文中一共展示了UObject::GetInterfaceAddress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ImportText_Internal
const TCHAR* UInterfaceProperty::ImportText_Internal( const TCHAR* InBuffer, void* Data, int32 PortFlags, UObject* Parent, FOutputDevice* ErrorText/*=NULL*/ ) const
{
FScriptInterface* InterfaceValue = (FScriptInterface*)Data;
UObject* ResolvedObject = InterfaceValue->GetObject();
void* InterfaceAddress = InterfaceValue->GetInterface();
const TCHAR* Buffer = InBuffer;
if ( !UObjectPropertyBase::ParseObjectPropertyValue(this, Parent, UObject::StaticClass(), PortFlags, Buffer, ResolvedObject) )
{
// we only need to call SetObject here - if ObjectAddress was not modified, then InterfaceValue should not be modified either
// if it was set to NULL, SetObject will take care of clearing the interface address too
InterfaceValue->SetObject(ResolvedObject);
return NULL;
}
// so we should now have a valid object
if ( ResolvedObject == NULL )
{
// if ParseObjectPropertyValue returned true but ResolvedObject is NULL, the imported text was "None". Make sure the interface pointer
// is cleared, then stop
InterfaceValue->SetObject(NULL);
return Buffer;
}
void* NewInterfaceAddress = ResolvedObject->GetInterfaceAddress(InterfaceClass);
if ( NewInterfaceAddress == NULL )
{
// the object we imported doesn't implement our interface class
ErrorText->Logf( TEXT("%s: specified object doesn't implement the required interface class '%s': %s"),
*GetFullName(), *InterfaceClass->GetName(), InBuffer );
return NULL;
}
InterfaceValue->SetObject(ResolvedObject);
InterfaceValue->SetInterface(NewInterfaceAddress);
return Buffer;
}