Source code of Windows XP (NT5)
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.

136 lines
4.5 KiB

  1. // Container.h -- Container class declaration
  2. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  3. // 1999. This computer program includes Confidential, Proprietary
  4. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  5. // use, disclosure, and/or reproduction is prohibited unless authorized
  6. // in writing. All Rights Reserved.
  7. #if !defined(SLBCSP_CONTAINER_H)
  8. #define SLBCSP_CONTAINER_H
  9. #include <string>
  10. #include <stack>
  11. #include <cciCont.h>
  12. #include "slbRCPtr.h"
  13. #include "CachingObj.h"
  14. #include "cspec.h"
  15. // Forward declaration necessary to satisfy HContainer's declaration
  16. class Container;
  17. class HContainer
  18. : public slbRefCnt::RCPtr<Container>
  19. {
  20. public:
  21. // Types
  22. // C'tors/D'tors
  23. HContainer(Container *pacntr = 0);
  24. // Operators
  25. // Operations
  26. // Access
  27. // Predicates
  28. protected:
  29. // Types
  30. // C'tors/D'tors
  31. // Operators
  32. // Operations
  33. // Access
  34. // Predicates
  35. // Variables
  36. private:
  37. // Types
  38. // C'tors/D'tors
  39. // Operators
  40. // Operations
  41. // Access
  42. // Predicates
  43. // Variables
  44. };
  45. // Container is a reference counted wrapper to a CCI
  46. //
  47. // One unique CCI container is maintained for all threads since
  48. // the CCI does not reflect changes made to one CContainer in all
  49. // CContainer objects that refer to the same container.
  50. //
  51. // The container cannot be created unless the container
  52. // it represents is exists on the card.
  53. class Container
  54. : public slbRefCnt::RCObject,
  55. public CachingObject
  56. {
  57. public:
  58. // Types
  59. // Friends
  60. // C'tors/D'tors
  61. static HContainer
  62. MakeContainer(CSpec const & rcspec,
  63. cci::CContainer const &rccntr);
  64. ~Container();
  65. // Operators
  66. // Operations
  67. void
  68. ClearCache();
  69. // Access
  70. virtual cci::CContainer
  71. TheCContainer() const;
  72. static HContainer
  73. Find(CSpec const &rKey);
  74. CSpec const &
  75. TheCSpec() const;
  76. // Predicates
  77. protected:
  78. // Types
  79. // C'tors/D'tors
  80. Container(); //Default c'tor
  81. // Operators
  82. // Operations
  83. // Variables
  84. cci::CContainer mutable m_hcntr; // cached container
  85. private:
  86. // Types
  87. // C'tors/D'tors
  88. explicit
  89. Container(CSpec const &rKey);
  90. explicit
  91. Container(CSpec const &rKey,
  92. cci::CContainer const &rccard);
  93. // Operators
  94. // Operations
  95. // Access
  96. // Predicates
  97. // Variables
  98. // The card could be derived from the CCI container object but
  99. // since the CCI allows card objects to be reused, the card may
  100. // not be the container originally found. The CardContext class
  101. // tries to mitigate that problem by storing an HCardContext in a
  102. // container's context object.
  103. CSpec m_cspec;
  104. };
  105. #endif // SLBCSP_CONTAINER_H