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.

120 lines
4.0 KiB

  1. /*
  2. * REVISIONS:
  3. * pcy02Feb93: GetCode() needs to be const
  4. * cad07Oct93: Plugging Memory Leaks
  5. * cad29Oct93: Added get next attr
  6. * mwh05May94: #include file madness , part 2
  7. * mds10Jul97: changed GetFirstAttribute() to const so that it can be
  8. * used by the Equal() method
  9. */
  10. #ifndef __TRANS_H
  11. #define __TRANS_H
  12. _CLASSDEF(Attribute)
  13. _CLASSDEF(TransactionObject)
  14. _CLASSDEF(TransactionItem)
  15. _CLASSDEF(TransactionGroup)
  16. _CLASSDEF(Event)
  17. _CLASSDEF(List)
  18. _CLASSDEF(ListIterator)
  19. _CLASSDEF(Message)
  20. #include "apc.h"
  21. #include "apcobj.h"
  22. class TransactionObject : public Obj
  23. {
  24. protected:
  25. Type theType;
  26. INT theId;
  27. List* theProtocolMessageList;
  28. ListIterator* thePMIterator;
  29. public:
  30. TransactionObject(Type aType, INT anId);
  31. virtual ~TransactionObject();
  32. Type GetType() {return theType;};
  33. INT GetId() const {return theId;};
  34. List* GetProtocolMessageList() {return theProtocolMessageList;}
  35. VOID AddMessage(PMessage aMessage);
  36. VOID SetType(Type thetype) {theType = thetype;};
  37. VOID SetId(INT id) {theId = id;}
  38. };
  39. class TransactionItem : public TransactionObject
  40. {
  41. private:
  42. static INT transactionItemCount;
  43. protected:
  44. INT theCode;
  45. CHAR *theValue;
  46. INT theErrorCode;
  47. List *theAttributeList;
  48. ListIterator *theAttribIterator;
  49. public:
  50. TransactionItem(Type aType, INT aCode, CHAR* aValue = NULL);
  51. virtual ~TransactionItem();
  52. INT GetCode() const {return theCode;};
  53. CHAR* GetValue() {return theValue;};
  54. INT GetErrorCode() {return theErrorCode;};
  55. List* GetAttributeList(){return theAttributeList;};
  56. VOID SetValue(CHAR* aValue);
  57. VOID SetCode(INT aCode) {theCode = aCode;};
  58. VOID SetErrorCode(INT anErrorCode) {theErrorCode = anErrorCode;};
  59. VOID AddAttribute(INT anAttributeCode, CHAR* aValue);
  60. VOID AddAttribute(PAttribute anAttribute);
  61. PAttribute GetFirstAttribute() const;
  62. PAttribute GetNextAttribute();
  63. virtual INT IsA() const { return TRANSACTIONITEM;}
  64. virtual INT Equal( RObj ) const;
  65. };
  66. class TransactionGroup : public TransactionObject
  67. {
  68. private:
  69. static INT transactionGroupCount;
  70. protected:
  71. CHAR* theAuthenticationString;
  72. List* theEventList;
  73. ListIterator *theEventIterator;
  74. List* theTransactionList;
  75. ListIterator *theTransactionIterator;
  76. CHAR* theResponse;
  77. CHAR* InitialSetResponse;
  78. INT InitialSetResponseRepeated;
  79. INT theErrorIndex;
  80. INT theErrorCode;
  81. public:
  82. TransactionGroup(Type aType);
  83. virtual ~TransactionGroup();
  84. PTransactionItem GetFirstTransactionItem();
  85. PTransactionItem GetNextTransactionItem();
  86. PTransactionItem GetCurrentTransaction();
  87. List* GetEventList() {return theEventList;}
  88. List* GetTransactionItemList() {return theTransactionList;}
  89. CHAR* GetAuthentication() {return theAuthenticationString;};
  90. CHAR* GetResponse() {return theResponse;};
  91. CHAR* GetInitialSetResponse() {return InitialSetResponse;}
  92. INT GetInitialSetResponseRepeated() {return InitialSetResponseRepeated;}
  93. INT GetErrorIndex() {return theErrorIndex;}
  94. INT GetErrorCode() {return theErrorCode;};
  95. VOID SetErrorCode(INT anErrorCode) {theErrorCode = anErrorCode;};
  96. VOID SetResponse(CHAR* aString);
  97. VOID SetAuthentication(CHAR* aString);
  98. VOID SetInitialSetResponseRepeated(INT repeat);
  99. VOID SetInitialSetResponse(CHAR* initialResponse);
  100. VOID SetErrorIndex(INT index);
  101. INT AddTransactionItem(PTransactionItem aTransaction);
  102. INT AddEvent(PEvent anEvent);
  103. virtual INT IsA() const { return TRANSACTIONGROUP;}
  104. virtual INT Equal( RObj ) const;
  105. };
  106. #endif