be1c7363e0624a2e9698c05c71d76b0c566624d5
[mono.git] / mcs / class / corlib / System.Runtime.Remoting.Proxies / RealProxy.cs
1 //
2 // System.Runtime.Remoting.Proxies.RealProxy.cs
3 //
4 // Authors:
5 //   Dietmar Maurer (dietmar@ximian.com)
6 //
7 // (C) 2001 Ximian, Inc.  http://www.ximian.com
8 //
9
10 using System;
11 using System.Runtime.Remoting.Messaging;
12 using System.Runtime.CompilerServices;
13
14
15 namespace System.Runtime.Remoting.Proxies
16 {
17         internal class TransparentProxy {
18                 public RealProxy _rp;
19         }
20         
21         public abstract class RealProxy {
22
23                 Type class_to_proxy;
24
25                 protected RealProxy () {
26                         throw new NotImplementedException ();
27                 }
28
29                 protected RealProxy (Type classToProxy) {
30                         this.class_to_proxy = classToProxy;
31                 }
32
33                 protected RealProxy (Type classToProxy, IntPtr stub, object stubData) {
34                         throw new NotImplementedException ();
35                 }
36
37                 public abstract IMessage Invoke (IMessage msg);
38
39                 /* this is called from unmanaged code */
40                 internal static object PrivateInvoke (RealProxy rp, IMessage msg, out Exception exc,
41                                                       out object [] out_args)
42                 {
43                         IMethodReturnMessage res_msg = (IMethodReturnMessage)rp.Invoke (msg);
44
45                         exc = res_msg.Exception;
46                         out_args = res_msg.OutArgs;
47                         return res_msg.ReturnValue;
48                 }
49
50                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
51                 public extern virtual object GetTransparentProxy ();
52                 
53         }
54
55 }