Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.4 KiB

  1. #ifndef _INSTDATA_H_
  2. #define _INSTDATA_H_
  3. // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  4. //
  5. // INSTDATA.H
  6. //
  7. // Header for Dav Instance cache class.
  8. // (This cache hold per-instance data. An instance is an
  9. // installation of DAV with a particular VServer-VRoot combination.)
  10. // Items declared here are defined(implemented) in inst.cpp.
  11. //
  12. // Copyright 1997 Microsoft Corporation, All Rights Reserved
  13. //
  14. // ========================================================================
  15. // Implementation note:
  16. // We need the classes CONTAINED in the inst to be completely defined here.
  17. // I decided to make these classes CONTAINED directly for speed purposes.
  18. // If we ever want to switch to holding an interface instead, replace
  19. // these definitions with the interface declaration, and have all the
  20. // actual classes use the interface. The interface must provide for
  21. // creating and destroying the objects -- don't forget to change the
  22. // CInstData dtor to destroy all its objects! --BeckyAn
  23. //
  24. // Caches
  25. #include "gencache.h"
  26. // Scrip map cache
  27. #include "scrptmps.h"
  28. // Singleton template
  29. #include <singlton.h>
  30. // Instance data object
  31. #include <instobj.h>
  32. // ========================================================================
  33. //
  34. // CLASS CInstDataCache
  35. //
  36. // The instance data cache. Contains one "row" (CInstData) for each
  37. // "instance" (virtual server/virtual root combination).
  38. // Only one should ever be created in any DAV dll.
  39. //
  40. // A virtual server (or site) is IIS's mechanism for hosting more than one
  41. // web site on a single machine -- www.msn.com and www.microsoft.com
  42. // running off of different directories on the same machine.
  43. // A virtual server is addressed by IIS as an instance number under
  44. // the w3svc service (w3svc/1/root, w3svc/2/root, etc)
  45. // A virtual root is IIS's mechanism for mapping virtual directories
  46. // under a particular vserver to different parts of the file system --
  47. // the URI /becky could map to d:\msn\web\users\b\becky.
  48. // DAV uses a virtual directory as the root of its document access --
  49. // all requests with URIs under our vroot are serviced by DAV.
  50. // DAV can also be installed under many different vroots at the same
  51. // time. The instance data allows us to maintain seperate setting
  52. // and data for each vroot.
  53. //
  54. // To get the data row for the current instance, use GetInstData(ECB).
  55. //
  56. class CInstDataCache : private Singleton<CInstDataCache>
  57. {
  58. //
  59. // Friend declarations required by Singleton template
  60. //
  61. friend class Singleton<CInstDataCache>;
  62. // The instance data cache
  63. //
  64. CMTCache<CRCWsz, auto_ref_ptr<CInstData> > m_cache;
  65. // NOT IMPLEMENTED
  66. //
  67. CInstDataCache& operator=( const CInstDataCache& );
  68. CInstDataCache( const CInstDataCache& );
  69. // CONSTRUCTORS
  70. //
  71. // Declared private to ensure that arbitrary instances
  72. // of this class cannot be created. The Singleton
  73. // template (declared as a friend above) controls
  74. // the sole instance of this class.
  75. //
  76. CInstDataCache() {}
  77. public:
  78. // STATICS
  79. //
  80. //
  81. // Instance creating/destroying routines provided
  82. // by the Singleton template.
  83. //
  84. using Singleton<CInstDataCache>::CreateInstance;
  85. using Singleton<CInstDataCache>::DestroyInstance;
  86. //
  87. // Per-vroot instance data accessor
  88. //
  89. static CInstData& GetInstData( const IEcb& ecb );
  90. };
  91. #endif // _INSTDATA_H_