PSFactory.h
上传用户:nvosite88
上传日期:2007-01-17
资源大小:4983k
文件大小:2k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* PSFactory.h - COM/DCOM PSFactory class definition */
  2. /* Copyright (c) 1999 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01n,25jul01,dbs  revise facelet/proxy classes
  7. 01m,13jul01,dbs  fix up includes
  8. 01l,08jun99,dbs  remove use of mtmap
  9. 01k,04jun99,dbs  change GuidMap to mtmap
  10. 01j,28may99,dbs  make stub disp-tbl a structure
  11. 01i,14may99,dbs  use new stub-func type
  12. 01h,11may99,dbs  simplify proxy remoting architecture
  13. 01g,11may99,dbs  change name of ChannelBuffer.h to Remoting.h
  14. 01f,11may99,dbs  simplify stub remoting architecture
  15. 01e,29apr99,dbs  fix -Wall warnings
  16. 01d,27apr99,dbs  make PSFactory a true singleton
  17. 01c,27apr99,dbs  add mem-pool to classes
  18. 01b,21apr99,dbs  add include for IRpcChannelBuffer
  19. 01a,20apr99,dbs  created during Grand Renaming
  20. */
  21. #ifndef __INCPSFactory_h
  22. #define __INCPSFactory_h
  23. #include "dcomLib.h"
  24. #include "private/comMisc.h"
  25. #include "private/comStl.h"
  26. #include "Stublet.h"
  27. #include "InterfaceProxy.h"
  28. ///////////////////////////////////////////////////////////////////////////
  29. //
  30. // VxPSFactory - proxy/stub factory class - there is only ever one of
  31. // these objects, and it remains around forever...
  32. //
  33. struct psentry
  34.     {
  35.     const void* pvProxyVtbl;
  36.     const VXDCOM_STUB_DISPTBL* pStubDispTbl;
  37.     psentry (const void* pp, const VXDCOM_STUB_DISPTBL* ps)
  38.       : pvProxyVtbl (pp), pStubDispTbl (ps)
  39. {}
  40.     psentry () : pvProxyVtbl (0), pStubDispTbl (0)
  41. {}
  42.     };
  43. class VxPSFactory
  44.     {
  45.     typedef STL_MAP(IID, psentry) PSMAP;
  46.     PSMAP m_psMap;
  47.     VxMutex m_mutex;
  48.     
  49.     VxPSFactory () {}
  50.   public:
  51.     static VxPSFactory* theInstance ();
  52.     
  53.     virtual ~VxPSFactory () {}
  54.     // Register a proxy/stub pair with the factory...
  55.     HRESULT Register
  56. (
  57. REFIID  iid,
  58. const void* pvProxyVtbl,
  59. const VXDCOM_STUB_DISPTBL* pStubDispTbl
  60. );
  61.     // Create a stublet...
  62.     VxStublet* CreateStublet
  63. (
  64. IUnknown* punkServer,
  65. REFIID iid,
  66. REFIPID ipid
  67. );
  68.     // Create a facelet...
  69.     HRESULT CreateProxy
  70. (
  71. IUnknown *      pUnkOuter,
  72. REFIID          iid,
  73. REFIPID         ipid,
  74.         IOrpcProxy**    ppProxy
  75. );
  76.     
  77.     };
  78. #endif