📄 interfaceproxy.h
字号:
/* InterfaceProxy.h - COM/DCOM InterfaceProxy class definition *//* Copyright (c) 1998 Wind River Systems, Inc. *//*modification history--------------------01n,24jul01,dbs add public inner-proxy structure01m,19jul01,dbs fix include-path of Remoting.h01l,13jul01,dbs fix up includes01k,06jul99,dbs add copy-ctor and assignment-operator01j,10jun99,dbs remove inclusion of comNew.h01i,03jun99,dbs remove refs to comSyncLib01h,13may99,dbs remove usage of IRpcChannelBuffer01g,11may99,dbs simplify proxy remoting architecture01f,11may99,dbs change name of ChannelBuffer.h to Remoting.h01e,29apr99,dbs fix -Wall warnings01d,28apr99,dbs make all classes allocate from same pool01c,27apr99,dbs add mem-pool to class01b,21apr99,dbs add include for IRpcChannelBuffer01a,20apr99,dbs created during Grand Renaming*/#ifndef __INCInterfaceProxy_h#define __INCInterfaceProxy_h#include "private/comMisc.h"#include "dcomLib.h"#include "orpc.h"/////////////////////////////////////////////////////////////////////////////// VxInterfaceProxy - a single-interface proxy object that can be// aggregated by the 'proxy manager' VxStdProxy and represents a// single interface on a 'remoted' object.//// It will be used by the proxy-stub generation code to implement the// methods for the real proxy when standard marshaling is used. The// actual implementation of the managed-interface methods takes place// in functions in the managed vtable.//// The class implements IUnknown directly -- this is the 'real'// IUnknown for the facelet, and so it manages the facelet's own// reference count. The 'managed interface' is contained in a// 'interface_t' structure, which is returned when a VxInterfaceProxy// is QI'ed for the managed IID.//// This implements the aggregation necessary for the managed interface// to appear as part of the containing StdProxy -- the interface_t// object defers its IUnknown methods to the StdProxy, and the// VxInterfaceProxy's own implementation of IUnknown provides the// private IUnknown that is only seen by the aggregating StdProxy...//// The XXX_vxproxy functions generated by WIDL for the managed// interface are conceptually the methods of this interface-proxy's// implementation of the managed interface. They are present in the// vtable and so are effectively part fo this interface proxy.//// However, for method calls to be dispatched, the only requirement is// that the proxy eventually calls IOprcClientChannel::InvokeMethod()// which happens in the SendReceive() method of RpcProxyMsg for normal// interfaces (i.e. those handled by standard marshaling). If an// alternate proxy/stub class were associated with a particular// interface (e.g. to do custom marshaling), then it would either need// to call that function itself (which is why the IOrpcProxy interface// has the Connect() and Disconnect() methods, so it has access to the// channel), or it must arrange for data to be sent to the remote// machine itself, somehow.//class VxInterfaceProxy;struct interface_t { const void * lpVtbl; // inner interface impl long magic; // magic ID value VxInterfaceProxy * backptr; // validation pointer };class VxInterfaceProxy : public IOrpcProxy { interface_t m_interface; // managed interface IID m_iidManaged; // IID of inner interface IPID m_ipid; // IPID of exposed interface LONG m_dwRefCount; // reference count IUnknown * m_pUnkOuter; // aggregating outer IOrpcClientChannel* m_pChannel; // client channel VxInterfaceProxy& operator= (const VxInterfaceProxy&); VxInterfaceProxy::VxInterfaceProxy (const VxInterfaceProxy&); public: // ctor and dtor VxInterfaceProxy (REFIID, REFIPID, IUnknown*, const void*); virtual ~VxInterfaceProxy (); HRESULT interfaceInfoGet (IPID*, IOrpcClientChannel**); IUnknown* pUnkOuter () const { return m_pUnkOuter; } // find containing interface-proxy from any interface pointer static VxInterfaceProxy* safe_cast (const void*); // IOrpcProxy methods STDMETHOD(QueryInterface) (REFIID riid, void** ppv); STDMETHOD_(ULONG, AddRef) (); STDMETHOD_(ULONG, Release) (); STDMETHOD(Connect) (IOrpcClientChannel*); STDMETHOD(Disconnect) (); };#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -