UDN
Search public documentation:

PlatformInterfaceFramework
日本語訳
中国翻译
한국어

Interested in the Unreal Engine?
Visit the Unreal Technology site.

Looking for jobs and company info?
Check out the Epic games site.

Questions about support via UDN?
Contact the UDN Staff

UE3 Home > Mobile Home > PlatformInterface Framework

PlatformInterface Framework


ALERT! This document describes features and systems added in the August 2011 Build

Overview


The PlatformInterface framework provides a base for the various platform interface classes and has support for a generic delegate system, as well has having subclasses determine if they should register for a tick.

Platform interfaces

PlatformInterfaceBase


PlatformInterfaceBase is the base class for all platform interface classes. Each platform interface extends from this class, adding its own functionality specific to the platform and defining its own delegate types.

Platform Interface Delegates


The generic delegate system consists of a single delegate signature that is used by all delegates within the PlatformInterface framework.

  delegate PlatformInterfaceDelegate(const out PlatformInterfaceDelegateResult Result);
  

Any function to be used as a callback from a delegate within the framework must then match this signature.

Delegates are assigned according to types defined in each platform interface subclass. An enum containing the available types must be dfined in each subclass. Functions are assigned to and cleared from delegates by passing the function and a value from this enum to one of the functions below:

  • AddDelegate [DelegateType] [InDelegate] -
    • DelegateType - An Int representing the item in the enum of the subclass defining the types of delegates available.
    • InDelegate - A function matching the PlatformInterfaceDelegate signature to be assigned to the delegate.
  • ClearDelegate [DelegateType] [InDelegate] -
    • DelegateType - An Int representing the item in the enum of the subclass defining the types of delegates available.
    • InDelegate - A function matching the PlatformInterfaceDelegate signature to be removed from the delegate.

Platform Interface Data Containers


Data is passed from the platform interface to the delegates through the use of a special type of data container, PlatformInterfaceDelegateResult. This is a struct consisting of the following:

  • bSuccessful - A bool specifying if the action performed was successful.
  • Data - The PlatformInterfaceData struct holding any data returned from the action performed. PlatformInterfaceData is a struct designed to hold generic data to be passed to a platform interface delegate. It consists of the following:
    • DataName - The Name specifying the optional tag for the data being returned.
    • Type - The EPlatformInterfaceDataType specifying the type of data held. This determines which, if any, of the *Value properties is valid and contains data.
      • PIDT_None - Specifies no value property contains data.
      • PIDT_Int - Specifies the IntValue property contains data.
      • PIDT_Float - Specifies the FloatValue property contains data.
      • PIDT_String - Specifies the StringValue property contains data.
      • PIDT_Object - Specifies the ObjectValue property contains data.
      • PIDT_Custom - Specifies more than one value property contains data.
    • IntValue - Holds integer data for the struct.
    • FloatValue - Holds float data for the struct.
    • StringValue - Holds string data for the struct.
    • ObjectValue - Holds Object data for the struct.