📄 stdstub.h
字号:
/* StdStub.h - COM/DCOM StdStub class definition *//* Copyright (c) 1999 Wind River Systems, Inc. *//*modification history--------------------01u,13jul01,dbs fix up includes01t,20sep00,nel Add changes made in T2 since branch.01s,27jul99,drm Returning CLSID from interfaceInfoGet().01r,29jun99,dbs remove obsolete ctor01q,28jun99,dbs make Relase() return refs so deletion can be done by OX01p,17jun99,aim uses new SCM01o,10jun99,dbs remove inclusion of comNew.h01n,08jun99,dbs remove use of mtmap01m,04jun99,dbs change GuidMap to mtmap01l,02jun99,dbs inherit from RpcDispatchTable01k,18may99,dbs change to new marshaling architecture01j,11may99,dbs remove inclusion of ChannelBuffer.h01i,11may99,dbs simplify stub remoting architecture01h,10may99,dbs add method to determine if interface is supported01g,28apr99,dbs make all classes allocate from same pool01f,26apr99,dbs remove class-specific debug code01e,26apr99,dbs add mem-pool to StubInfo class01d,26apr99,dbs add show command01c,23apr99,dbs add mem-pool to class01b,21apr99,dbs add include for IRpcChannelBuffer01a,20apr99,dbs created during Grand Renaming*/#ifndef __INCStdStub_h#define __INCStdStub_h#include "dcomProxy.h"#include "private/comMisc.h"#include "private/comStl.h"#include "RpcDispatchTable.h"/////////////////////////////////////////////////////////////////////////////// VxStdStub - the standard-marshaling stub (a.k.a. stub manager) which// represents the server-object for the purposes of remoting its // interfaces. It keeps a list of all the stublets (interface stubs)// it maintains, one for each remoted interface on the object, keyed// by their IPID, in the table m_stublets. It also maintains a// parallel table, m_interfaces, which maps from IID to stublet - this// increases lookup speed when determining if a particular interface// is supported by the stub itself.//// The VxStdStub object itself maintains one reference to the server,// and each stublet maintains one reference. Remote references are // counted per-IPID and only when the total remote ref-count reaches // zero is the VxStdStub object destroyed.//// Remote refs to the IUnknown of the server are kept in the// 'm_stublets' table just like all other refs - this makes it easier// to total up the outstanding refs, etc. However, it does mean the// IUnknown entry requires special treatment, as IUnknown is not// remoted, so sometimes (if the client has only asked for IUnknown)// then there will be an entry in m_interfaces for IID_IUnknown,// whereas normally there would be an entry for both IID_IUnknown and// some other IID both pointing to the same stublet.//class VxStublet;class VxStdStub : public RpcDispatchTable { typedef STL_MAP(GUID, VxStublet*) STUBLETMAP; IUnknown* m_pUnkServer; // server object STUBLETMAP m_stublets; // IPID -> Stublet STUBLETMAP m_interfaces; // IID -> Stublet OID m_oid; // object ID VxMutex m_mutex; // task safety VxStdStub& operator= (const VxStdStub&); VxStdStub::VxStdStub (const VxStdStub&); public: // ctor and dtor VxStdStub (); ~VxStdStub (); // RpcDispatchTable methods bool supportsInterface (REFIID); HRESULT interfaceInfoGet (REFIID, REFIPID, ULONG, IUnknown**, PFN_ORPC_STUB*, CLSID &); IUnknown* getIUnknown () const { return m_pUnkServer; } // adopt a particular server object... void adopt (IUnknown* punk, OID oid); // add an interface HRESULT interfaceAdd (REFIID iid, DWORD nRefs, IPID* pIpidNew); // add remote references per-IPID ULONG AddRef (ULONG n, REFIPID ipid); ULONG Release (ULONG n, REFIPID ipid);#ifdef VXDCOM_DEBUG void printOn (ostream& os);#endif };#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -