Beispiel #1
0
        protected virtual void CallMe_Implementation()
        {
            CheckDestroyed();
            if (!CallMe_IsValid)
            {
                NativeReflection.LogInvalidFunctionAccessed("/Script/USharp.BPTest1:CallMe");
                return;
            }
            unsafe
            {
                byte * ParamsBufferAllocation = stackalloc byte[CallMe_ParamsSize];
                IntPtr ParamsBuffer           = new IntPtr(ParamsBufferAllocation);

                NativeReflection.InvokeFunction(Address, CallMe_FunctionAddress, ParamsBuffer, CallMe_ParamsSize);
                NativeReflection.InvokeFunction_DestroyAll(CallMe_FunctionAddress, ParamsBuffer);
            }
        }
Beispiel #2
0
        private void Invoker()
        {
            if (!SomeDelegate__DelegateSignature_IsValid)
            {
                NativeReflection.LogInvalidFunctionAccessed("/Script/USharp.SomeDelegate__DelegateSignature");
                return;
            }
            if (IsBound)
            {
                unsafe
                {
                    byte * ParamsBufferAllocation = stackalloc byte[SomeDelegate__DelegateSignature_ParamsSize];
                    IntPtr ParamsBuffer           = new IntPtr(ParamsBufferAllocation);
                    FMemory.Memzero(ParamsBuffer, SomeDelegate__DelegateSignature_ParamsSize);

                    ProcessDelegate(ParamsBuffer);
                }
            }
        }
Beispiel #3
0
        private void Invoker(int SomeArgument)
        {
            if (!ActorDelegateTest__DelegateSignature_IsValid)
            {
                NativeReflection.LogInvalidFunctionAccessed("/Script/USharp.ActorDelegateTest__DelegateSignature");
                return;
            }
            if (IsBound)
            {
                unsafe
                {
                    byte * ParamsBufferAllocation = stackalloc byte[ActorDelegateTest__DelegateSignature_ParamsSize];
                    IntPtr ParamsBuffer           = new IntPtr(ParamsBufferAllocation);
                    FMemory.Memzero(ParamsBuffer, ActorDelegateTest__DelegateSignature_ParamsSize);
                    BlittableTypeMarshaler <int> .ToNative(IntPtr.Add(ParamsBuffer, ActorDelegateTest__DelegateSignature_SomeArgument_Offset), 0, ActorDelegateTest__DelegateSignature_SomeArgument_PropertyAddress.Address, SomeArgument);

                    ProcessDelegate(ParamsBuffer);
                }
            }
        }
Beispiel #4
0
        public void CallMe6(FMyStructCustomCtor test, ref FMyStructCustomCtor test2)
        {
            CheckDestroyed();
            if (!CallMe6_IsValid)
            {
                NativeReflection.LogInvalidFunctionAccessed("/Script/USharp.BPTest1:CallMe6");
                return;
            }
            unsafe
            {
                byte * ParamsBufferAllocation = stackalloc byte[CallMe6_ParamsSize];
                IntPtr ParamsBuffer           = new IntPtr(ParamsBufferAllocation);
                FMyStructCustomCtor.ToNative(IntPtr.Add(ParamsBuffer, CallMe6_test_Offset), test);
                FMyStructCustomCtor.ToNative(IntPtr.Add(ParamsBuffer, CallMe6_test2_Offset), test2);

                NativeReflection.InvokeFunction(Address, CallMe6_FunctionAddress, ParamsBuffer, CallMe6_ParamsSize);

                test2 = FMyStructCustomCtor.FromNative(IntPtr.Add(ParamsBuffer, CallMe6_test2_Offset));
                NativeReflection.InvokeFunction_DestroyAll(CallMe6_FunctionAddress, ParamsBuffer);
            }
        }
Beispiel #5
0
        public void CallMe()
        {
            CheckDestroyed();
            if (!CallMe_IsValid)
            {
                NativeReflection.LogInvalidFunctionAccessed("/Script/USharp.BPTest1:CallMe");
                return;
            }
            if (CallMe_InstanceFunctionAddress == IntPtr.Zero)
            {
                CallMe_InstanceFunctionAddress = NativeReflection.GetFunctionFromInstance(Address, "CallMe");
            }
            unsafe
            {
                byte * ParamsBufferAllocation = stackalloc byte[CallMe_ParamsSize];
                IntPtr ParamsBuffer           = new IntPtr(ParamsBufferAllocation);

                NativeReflection.InvokeFunction(Address, CallMe_InstanceFunctionAddress, ParamsBuffer, CallMe_ParamsSize);
                NativeReflection.InvokeFunction_DestroyAll(CallMe_InstanceFunctionAddress, ParamsBuffer);
            }
        }
Beispiel #6
0
        public List <string> CallMe3()
        {
            CheckDestroyed();
            if (!CallMe3_IsValid)
            {
                NativeReflection.LogInvalidFunctionAccessed("/Script/USharp.BPTest1:CallMe3");
                return(default(List <string>));
            }
            unsafe
            {
                byte * ParamsBufferAllocation = stackalloc byte[CallMe3_ParamsSize];
                IntPtr ParamsBuffer           = new IntPtr(ParamsBufferAllocation);

                NativeReflection.InvokeFunction(Address, CallMe3_FunctionAddress, ParamsBuffer, CallMe3_ParamsSize);

                TArrayCopyMarshaler <string> CallMe3_ReturnValue_Marshaler = new TArrayCopyMarshaler <string>(1, CallMe3_ReturnValue_PropertyAddress, CachedMarshalingDelegates <string, FStringMarshaler> .FromNative, CachedMarshalingDelegates <string, FStringMarshaler> .ToNative);
                List <string> toReturn = CallMe3_ReturnValue_Marshaler.FromNative(IntPtr.Add(ParamsBuffer, CallMe3_ReturnValue_Offset));
                NativeReflection.InvokeFunction_DestroyAll(CallMe3_FunctionAddress, ParamsBuffer);
                return(toReturn);
            }
        }
Beispiel #7
0
        public void CallMe5(ref List <string> a1, List <string> a2)
        {
            CheckDestroyed();
            if (!CallMe5_IsValid)
            {
                NativeReflection.LogInvalidFunctionAccessed("/Script/USharp.BPTest1:CallMe5");
                return;
            }
            unsafe
            {
                byte * ParamsBufferAllocation = stackalloc byte[CallMe5_ParamsSize];
                IntPtr ParamsBuffer           = new IntPtr(ParamsBufferAllocation);
                TArrayCopyMarshaler <string> CallMe5_a1_Marshaler = new TArrayCopyMarshaler <string>(1, CallMe5_a1_PropertyAddress, CachedMarshalingDelegates <string, FStringMarshaler> .FromNative, CachedMarshalingDelegates <string, FStringMarshaler> .ToNative);
                CallMe5_a1_Marshaler.ToNative(IntPtr.Add(ParamsBuffer, CallMe5_a1_Offset), a1);
                TArrayCopyMarshaler <string> CallMe5_a2_Marshaler = new TArrayCopyMarshaler <string>(1, CallMe5_a2_PropertyAddress, CachedMarshalingDelegates <string, FStringMarshaler> .FromNative, CachedMarshalingDelegates <string, FStringMarshaler> .ToNative);
                CallMe5_a2_Marshaler.ToNative(IntPtr.Add(ParamsBuffer, CallMe5_a2_Offset), a2);

                NativeReflection.InvokeFunction(Address, CallMe5_FunctionAddress, ParamsBuffer, CallMe5_ParamsSize);

                a1 = CallMe5_a1_Marshaler.FromNative(IntPtr.Add(ParamsBuffer, CallMe5_a1_Offset));
                NativeReflection.InvokeFunction_DestroyAll(CallMe5_FunctionAddress, ParamsBuffer);
            }
        }