⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rmaengin.pas

📁 Delphi源码REAlRMSDK.rar
💻 PAS
📖 第 1 页 / 共 3 页
字号:
    (************************************************************************
     *	Method:
     *	    IRMAInterruptState::LeaveInterruptState
     *	Purpose:
     *	    This function is called when leaving a deferred/interrupt task
     *)

    function LeaveInterruptState: HRESULT; stdcall;

    (************************************************************************
     *	Method:
     *	    IRMAInterruptState::EnableInterrupt
     *	Purpose:
     *	    This function can be called to enable/disable interrupt time
     *	    processsing
     *)

    function EnableInterrupt(bEnable: BOOL): HRESULT; stdcall;

    (************************************************************************
     *	Method:
     *	    IRMAInterruptState::IsInterruptEnabled
     *	Purpose:
     *	    This function can be called to find if the core is currently
     *	    interrupt enabled.
     *)

    function IsInterruptEnabled: BOOL; stdcall;
    
  end;
  {$EXTERNALSYM IRMAInterruptState}

(****************************************************************************
 * 
 *  Interface:
 * 
 *	IRMAOptimizedScheduler
 * 
 *  Purpose:
 * 
 *	This interface provides the user with a way of scheduling callbacks
 *	that will be executed at some time in the future.
 *
 *	This interface should ONLY be used if you need accurately timed 
 *	callbacks. These callbacks should be efficient and should not consume 
 *	much time/CPU. This is not a thread safe interface. The user has to 
 *	take care of synchronization in their callbacks.
 * 
 *  IID_IRMAOptimizedScheduler:
 *
 *	{0000010F-0901-11d1-8B06-00A024406D59}
 *
 *)

const
  IID_IRMAOptimizedScheduler: TGUID = '{0000010F-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM IID_IRMAOptimizedScheduler}

type
  IRMAOptimizedScheduler = interface (IUnknown)
  ['{0000010F-0901-11d1-8B06-00A024406D59}']

    (************************************************************************
     *	Method:
     *	    IRMAOptimizedScheduler::RelativeEnter
     *	Purpose:
     *	    Schedule a callback to be executed "ms" milliseconds from now
     *	    This function is less percise then AbsoluteEnter and should only
     *	    be used when accurate timing is not critical.
     *)

    function RelativeEnter(pCallback: IRMACallback; ms: UINT32): CallbackHandle; stdcall;

    (************************************************************************
     *	Method:
     *	    IRMAOptimizedScheduler::AbsoluteEnter
     *	Purpose:
     *	    Schedule a callback to be executed at time "tVal".
     *)

    function AbsoluteEnter(pCallback: IRMACallback; tVal: RMATimeval): CallbackHandle; stdcall;

    (************************************************************************
     *	Method:
     *	    IRMAOptimizedScheduler::Remove
     *	Purpose:
     *	    Remove a callback from the scheduler.
     *)

    function Remove(Handle: CallbackHandle): HRESULT; stdcall;

    (************************************************************************
     *	Method:
     *	    IRMAOptimizedScheduler::GetCurrentSchedulerTime
     *	Purpose:
     *	    Gives the current time (in the timeline of the scheduler).
     *)

    function GetCurrentSchedulerTime: RMATimeval; stdcall;

  end;
  {$EXTERNALSYM IRMAOptimizedScheduler}

(****************************************************************************
 *
 *  Interface:
 *
 *	IRMALoadBalancedListen
 *
 *  Purpose:
 *
 *	This interface is queried off of IRMAListenSocket.  It allows
 *	a plugin to specify that it wants the server to load balance
 *	multiple instances of itself.  The server will instantiate multiple
 *	instances of the plugin as needed based on socket / descriptor limits.
 *	Each plugin instance should attempt to listen on the same port as
 *	other instances (they will share the port).
 *
 *  IID_IRMALoadBalancedListen:
 *
 *	{00000110-0901-11d1-8B06-00A024406D59}
 *
 *)

const
  IID_IRMALoadBalancedListen: TGUID = '{00000110-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM IID_IRMALoadBalancedListen}

type
  IRMALoadBalancedListen = interface (IUnknown)
  ['{00000110-0901-11d1-8B06-00A024406D59}']

    (************************************************************************
     *	Method:
     *	    IRMALoadBalancedListen::SetID
     *	Purpose:
     *	    This function set's the unique ID for this listen socket.  This
     *	    ID is used to determine whether or not different instances of
     *	    a plugin trying to listen on a single port are actually the
     *	    same plugin.  Without this function, it would be possible for
     *	    two completely different plugins to listen on the same port using
     *	    the load balanced listener.
     *)

    function SetID(const ID: TGUID): HRESULT; stdcall;

    (************************************************************************
     *	Method:
     *	    IRMALoadBalancedListen::SetReserveLimit
     *	Purpose:
     *	    Sets the reserve limit for descriptors / sockets.  If less
     *	    than reserve limit descriptors / sockets are left then a new
     *	    instance of the plugin will be created.
     *)

    function SetReserveLimit(ulDescriptors, ulSockets: UINT32): HRESULT; stdcall;
    
  end;
  {$EXTERNALSYM IRMALoadBalancedListen}

(****************************************************************************
 * 
 *  Interface:
 * 
 *	IRMAOverrideDefaultServices
 * 
 *  Purpose:
 * 
 *	This interface is queried off of the context.  It allows
 *	a plugin to override any default services provided by the G2 system.
 *	Currently, it is supported only on the client side. 
 *	You may currently override IRMANetworkServices using this interface
 *	You can use the same interface to later restore back the overriden services.
 *	This is done by calling the same OverrideServices() function with the 
 *	original service QIed before the initial override.
 * 
 *  IID_IRMAOverrideDefaultServices:
 * 
 *	{00000111-0901-11d1-8B06-00A024406D59}
 *
 *)

const
  IID_IRMAOverrideDefaultServices: TGUID = '{00000111-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM IID_IRMAOverrideDefaultServices}

type
  IRMAOverrideDefaultServices = interface (IUnknown)
  ['{00000111-0901-11d1-8B06-00A024406D59}']

   (************************************************************************
    *  Method:
    *      IRMAOverrideDefaultServices::OverrideServices
    *  Purpose:
    *      Override default services provided by the G2 system.
    *
    *)

    function OverrideServices(pContext: IUnknown): HRESULT; stdcall;

  end;
  {$EXTERNALSYM IRMAOverrideDefaultServices}

  PN_SOCKET_OPTION = (
    PN_SOCKOPT_REUSE_ADDR,
    PN_SOCKOPT_REUSE_PORT,
    PN_SOCKOPT_BROADCAST,
    PN_SOCKOPT_SET_RECVBUF_SIZE,
    PN_SOCKOPT_SET_SENDBUF_SIZE);
  {$EXTERNALSYM PN_SOCKET_OPTION}

(****************************************************************************
 * 
 *  Interface:
 * 
 *	IRMASetSocketOption
 * 
 *  Purpose:
 * 
 *	Set sockt option
 * 
 *  IID_IRMASetSocketOption:
 * 
 *	IID_IRMASetSocketOption:    {00000114-0901-11d1-8B06-00A024406D59}
 *
 *)

const
  IID_IRMASetSocketOption: TGUID = '{00000114-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM IID_IRMASetSocketOption}

type
  IRMASetSocketOption = interface (IUnknown)
  ['{00000114-0901-11d1-8B06-00A024406D59}']

    function SetOption(option: PN_SOCKET_OPTION; ulValue: UINT32): HRESULT; stdcall;

  end;
  {$EXTERNALSYM IRMASetSocketOption}

const
  RMA_THREADSAFE_METHOD_FF_GETPACKET = $00000001;
  {$EXTERNALSYM RMA_THREADSAFE_METHOD_FF_GETPACKET}

(*
 * FileFormat::GetPacket() only calls:
 *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
 *     FS->Read(), FS->Close(), FS->Seek(),
 *     FFR->PacketReady(), FFR->StreamDone()
 *     Context->Scheduler->*,
 *     CCF->CI(Mutex), Mutex->*
 *     Context->ErrorMessages
 *
 * XXXSMPNOW
 *)

  RMA_THREADSAFE_METHOD_FS_READ = $00000002;
  {$EXTERNALSYM RMA_THREADSAFE_METHOD_FS_READ}

(*
 * FileSystem::Read()/Seek()/Close() only calls:
 *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
 *     FS->Read(), FS->Close(), FS->Seek(),
 *     Context->Scheduler->*,
 *     CCF->CI(Mutex), Mutex->*
 *     Context->ErrorMessages
 *
 * XXXSMPNOW
 *)

  RMA_THREADSAFE_METHOD_FSR_READDONE  = $00000004;
  {$EXTERNALSYM RMA_THREADSAFE_METHOD_FSR_READDONE}

(*
 * FileFormat::ReadDone()/SeekDone()/CloseDone() only calls:
 *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
 *     FS->Read(), FS->Close(), FS->Seek(),
 *     FFR->PacketReady(), FFR->StreamDone()
 *     Context->Scheduler->*,
 *     CCF->CI(Mutex), Mutex->*
 *     Context->ErrorMessages
 *
 * XXXSMPNOW
 *)

  RMA_THREADSAFE_METHOD_CACHE_FILE = $00000008;
  {$EXTERNALSYM RMA_THREADSAFE_METHOD_CACHE_FILE}

(*
 * FileSystem::Read()/Seek()/Close() only calls:
 *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
 *     FS->Read(), FS->Close(), FS->Seek(),
 *     IRMACacheFile->*, IRMACacheFileResponse->*,
 *     Context->Scheduler->*,
 *     CCF->CI(Mutex), Mutex->*
 *     Context->ErrorMessages
 *
 * XXXSMPNOW
 *)

  RMA_THREADSAFE_METHOD_CACHE_FILE_RESPONSE = $00000010;
  {$EXTERNALSYM RMA_THREADSAFE_METHOD_CACHE_FILE_RESPONSE}

(*
 * FileSystem::Read()/Seek()/Close() only calls:
 *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
 *     FS->Read(), FS->Close(), FS->Seek(),
 *     IRMACacheFile->*, IRMACacheFileResponse->*,
 *     Context->Scheduler->*,
 *     CCF->CI(Mutex), Mutex->*
 *     Context->ErrorMessages
 *
 * XXXSMPNOW
 *)

(****************************************************************************
 * 
 *  Interface:
 * 
 *	IRMAThreadSafeMethods
 * 
 *  Purpose:
 * 
 *	XXXSMPNOW
 * 
 *  IID_IRMAThreadSafeMethods:
 * 
 *	{00000115-0901-11d1-8B06-00A024406D59}
 *
 *)

const
  IID_IRMAThreadSafeMethods: TGUID = '{00000115-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM IID_IRMAThreadSafeMethods}

type
  IRMAThreadSafeMethods = interface (IUnknown)
  ['{00000115-0901-11d1-8B06-00A024406D59}']

    (************************************************************************
     *	Method:
     *	    IRMAThreadSafeMethods::IsThreadSafe
     *	Purpose:
     *	    XXXSMPNOW
     *)

    function IsThreadSafe: UINT32; stdcall;

  end;
  {$EXTERNALSYM IRMAThreadSafeMethods}


(****************************************************************************
 * 
 *  Interface:
 * 
 *	IRMAMutex
 * 
 *  Purpose:
 * 
 *	XXXSMPNOW
 * 
 *  IID_IRMAMutex:
 * 
 *	{00000116-0901-11d1-8B06-00A024406D59}
 *
 *)

const
  IID_IRMAMutex: TGUID = '{00000116-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM IID_IRMAMutex}

(*
 *  The IRMACommonClassFactory supports creating an instance
 *  of this object.
 *)

  CLSID_IRMAMutex: TGUID = '{00000116-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM CLSID_IRMAMutex}

type
  IRMAMutex = interface (IUnknown)
  ['{00000116-0901-11d1-8B06-00A024406D59}']

    function Lock: HRESULT; stdcall;

    function TryLock: HRESULT; stdcall;

    function Unlock: HRESULT; stdcall;

  end;
  {$EXTERNALSYM IRMAMutex}

implementation

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -