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.

138 lines
3.8 KiB

  1. // V1Cont.cpp: implementation of the CV1Container class.
  2. //
  3. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  4. // 1999. This computer program includes Confidential, Proprietary
  5. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  6. // use, disclosure, and/or reproduction is prohibited unless authorized
  7. // in writing. All Rights Reserved.
  8. //////////////////////////////////////////////////////////////////////
  9. #include "NoWarning.h"
  10. #include <scuCast.h>
  11. #include "slbCci.h"
  12. #include "cciCard.h"
  13. #include "TransactionWrap.h"
  14. #include "V1ContRec.h"
  15. #include "V1Cont.h"
  16. using namespace std;
  17. using namespace cci;
  18. /////////////////////////// LOCAL/HELPER /////////////////////////////////
  19. /////////////////////////// PUBLIC /////////////////////////////////
  20. // Types
  21. // C'tors/D'tors
  22. CV1Container::CV1Container(CV1Card const &rv1card,
  23. string const &rsCntrTag,
  24. bool fCreateContainer)
  25. : SuperClass(rv1card)
  26. {
  27. CV1ContainerRecord::CreateMode mode = fCreateContainer
  28. ? CV1ContainerRecord::cmAlways
  29. : CV1ContainerRecord::cmNoCheck;
  30. m_apcr =
  31. auto_ptr<CV1ContainerRecord>(new CV1ContainerRecord(rv1card,
  32. rsCntrTag,
  33. mode));
  34. }
  35. CV1Container::~CV1Container() throw()
  36. {}
  37. // Operators
  38. // Operations
  39. void
  40. CV1Container::ID(string const &rstrID)
  41. {
  42. throw Exception(ccNotImplemented);
  43. }
  44. CV1Container *
  45. CV1Container::Make(CV1Card const &rv1card)
  46. {
  47. CTransactionWrap wrap(rv1card);
  48. return new CV1Container(rv1card, CV1ContainerRecord::DefaultName(),
  49. true);
  50. }
  51. void
  52. CV1Container::Name(string const &rstrName)
  53. {
  54. m_apcr->Name(rstrName);
  55. }
  56. // Access
  57. string
  58. CV1Container::ID()
  59. {
  60. throw Exception(ccNotImplemented);
  61. return string();
  62. }
  63. string
  64. CV1Container::Name()
  65. {
  66. return m_apcr->Name();
  67. }
  68. CV1ContainerRecord &
  69. CV1Container::Record() const
  70. {
  71. return *m_apcr.get();
  72. }
  73. // Predicates
  74. bool
  75. CV1Container::Exists() const
  76. {
  77. return m_apcr->Exists();
  78. }
  79. // Static Variables
  80. /////////////////////////// PROTECTED /////////////////////////////////
  81. // C'tors/D'tors
  82. // Operators
  83. // Operations
  84. void
  85. CV1Container::DoDelete()
  86. {
  87. m_hcard->InvalidateCache(); // to forget the key pairs
  88. m_apcr->Delete();
  89. }
  90. // Access
  91. // Predicates
  92. bool
  93. CV1Container::DoEquals(CAbstractContainer const &rhs) const
  94. {
  95. return true; // there can only be one container
  96. }
  97. // Static Variables
  98. /////////////////////////// PRIVATE /////////////////////////////////
  99. // C'tors/D'tors
  100. // Operators
  101. // Operations
  102. // Access
  103. // Predicates
  104. // Static Variables