Exemplo n.º 1
0
        private static void OnInjectedUpdatedEntity(System.IntPtr injectionBlob,
                                                    System.IntPtr injectionState,
                                                    System.IntPtr currentBlob,
                                                    System.IntPtr currentState,
                                                    System.IntPtr consumer,
                                                    out byte success)
        {
            success = Interface.ByteOf(false);
            try
            {
                using (InjectedEntityProxy proxy = new InjectedEntityProxy(injectionBlob,
                                                                           injectionState,
                                                                           currentBlob,
                                                                           currentState))
                {
                    ((EntityInjectionBase)ConsumerHandler.ToConsumer(consumer)).OnInjectedUpdatedEntity(proxy);
                }

                success = Interface.ByteOf(true);
            }
            catch (System.Exception exc)
            {
                Typesystem.LibraryExceptions.Instance.Set(exc);
            }
        }
Exemplo n.º 2
0
        private static void OnNewEntity(System.IntPtr currentBlob,
                                        System.IntPtr currentState,
                                        System.IntPtr consumer,
                                        byte timestampDiff,
                                        out byte success)
        {
            success = Interface.ByteOf(false);
            try
            {
                using (EntityProxy proxy = new EntityProxy(currentBlob,
                                                           currentState,
                                                           System.IntPtr.Zero,
                                                           System.IntPtr.Zero,
                                                           true,
                                                           Interface.BoolOf(timestampDiff)))
                {
                    ((EntitySubscriber)ConsumerHandler.ToConsumer(consumer)).OnNewEntity(proxy);
                }

                success = Interface.ByteOf(true);
            }
            catch (System.Exception exc)
            {
                Typesystem.LibraryExceptions.Instance.Set(exc);
            }
        }
Exemplo n.º 3
0
 private static void OnStopOrder(System.IntPtr connectionOwner, out byte success)
 {
     success = Interface.ByteOf(false);
     try
     {
         StopHandler cons =
             (StopHandler)ConsumerHandler.ToConsumer(connectionOwner);
         cons.OnStopOrder();
         success = Interface.ByteOf(true);
     }
     catch (System.Exception exc)
     {
         Typesystem.LibraryExceptions.Instance.Set(exc);
     }
 }
Exemplo n.º 4
0
 //-------------------------------------------------------------------------------------
 // Callback from Dose_Dll
 //-------------------------------------------------------------------------------------
 private static void OnDispatch(System.IntPtr dispatcher, out byte success)
 {
     success = Interface.ByteOf(false);
     try
     {
         Dispatcher cons =
             (Dispatcher)ConsumerHandler.ToConsumer(dispatcher);
         cons.OnDoDispatch();
         success = Interface.ByteOf(true);
     }
     catch (System.Exception exc)
     {
         Typesystem.LibraryExceptions.Instance.Set(exc);
     }
 }
Exemplo n.º 5
0
 private static void OnNotMessageOverflow(System.IntPtr messageSender,
                                          out byte success)
 {
     success = Interface.ByteOf(false);
     try
     {
         MessageSender cons = (MessageSender)ConsumerHandler.ToConsumer(messageSender);
         ConsumerHandler.Instance.DropReference(cons);
         cons.OnNotMessageOverflow();
         success = Interface.ByteOf(true);
     }
     catch (System.Exception exc)
     {
         Typesystem.LibraryExceptions.Instance.Set(exc);
     }
 }
Exemplo n.º 6
0
 private static void OnUnregistered(System.Int64 typeId,
                                    System.Int64 handlerId,
                                    System.IntPtr handlerIdStr,
                                    System.IntPtr consumer,
                                    out byte success)
 {
     success = Interface.ByteOf(false);
     try
     {
         ((RegistrationSubscriber)ConsumerHandler.ToConsumer(consumer))
         .OnUnregistered(typeId, new Safir.Dob.Typesystem.HandlerId(handlerId, Typesystem.Internal.InternalOperations.StringOf(handlerIdStr)));
         success = Interface.ByteOf(true);
     }
     catch (System.Exception exc)
     {
         Typesystem.LibraryExceptions.Instance.Set(exc);
     }
 }
Exemplo n.º 7
0
 private static void OnMessage(System.IntPtr message,
                               System.IntPtr state,
                               System.IntPtr consumer,
                               out byte success)
 {
     success = Interface.ByteOf(false);
     try
     {
         using (MessageProxy proxy = new MessageProxy(message, state))
         {
             ((MessageSubscriber)ConsumerHandler.ToConsumer(consumer)).OnMessage(proxy);
         }
         success = Interface.ByteOf(true);
     }
     catch (System.Exception exc)
     {
         Typesystem.LibraryExceptions.Instance.Set(exc);
     }
 }
Exemplo n.º 8
0
        private static void OnDropReference(System.IntPtr consumer,
                                            System.Int32 refCounter,
                                            out byte success)
        {
            success = Interface.ByteOf(false);
            try
            {
                Internal.ConsumerBase consumerBase = ConsumerHandler.ToConsumer(consumer);

                for (System.Int32 i = 0; i < refCounter; ++i)
                {
                    ConsumerHandler.Instance.DropReference(consumerBase);
                }
                success = Interface.ByteOf(true);
            }
            catch (System.Exception exc)
            {
                Typesystem.LibraryExceptions.Instance.Set(exc);
            }
        }
Exemplo n.º 9
0
        private static void OnInitialInjectionsDone(System.Int64 typeId,
                                                    System.Int64 handlerId,
                                                    System.IntPtr handlerIdStr,
                                                    System.IntPtr consumer,
                                                    out byte success)
        {
            success = Interface.ByteOf(false);
            try
            {
                ((EntityInjectionBase)ConsumerHandler.ToConsumer(consumer)).
                OnInitialInjectionsDone(typeId, new Safir.Dob.Typesystem.HandlerId
                                            (handlerId, Typesystem.Internal.InternalOperations.StringOf(handlerIdStr)));

                success = Interface.ByteOf(true);
            }
            catch (System.Exception exc)
            {
                Typesystem.LibraryExceptions.Instance.Set(exc);
            }
        }
Exemplo n.º 10
0
 private static void OnDeleteRequest(System.IntPtr state,
                                     System.Int32 ctrl,
                                     System.Int32 responseId,
                                     System.IntPtr consumer,
                                     out byte success)
 {
     success = Interface.ByteOf(false);
     try
     {
         ResponseSender rs = new ResponseSender(ctrl, consumer, responseId);
         using (EntityRequestProxy proxy = new EntityRequestProxy(System.IntPtr.Zero, state))
         {
             ((EntityRequestBase)ConsumerHandler.ToConsumer(consumer)).OnDeleteRequest(proxy, rs);
         }
         success = Interface.ByteOf(true);
     }
     catch (System.Exception exc)
     {
         Typesystem.LibraryExceptions.Instance.Set(exc);
     }
 }
Exemplo n.º 11
0
 private static void OnResponse(System.Int32 requestId,
                                System.IntPtr responseBlob,
                                System.IntPtr responseState,
                                System.IntPtr requestBlob,
                                System.IntPtr requestState,
                                System.IntPtr consumer,
                                out byte success)
 {
     success = Interface.ByteOf(false);
     try
     {
         using (ResponseProxy proxy = new ResponseProxy(requestId, responseBlob, responseState, requestBlob, requestState))
         {
             Requestor requestor = (Requestor)ConsumerHandler.ToConsumer(consumer);
             ConsumerHandler.Instance.DropReference(requestor);
             requestor.OnResponse(proxy);
         }
         success = Interface.ByteOf(true);
     }
     catch (System.Exception exc)
     {
         Typesystem.LibraryExceptions.Instance.Set(exc);
     }
 }