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.

101 lines
2.7 KiB

  1. //
  2. // MODULE: NODESTATE.H
  3. //
  4. // PURPOSE: Declare types and values relevant to NID (node ID) and IST (state)
  5. //
  6. // PROJECT: Generic Troubleshooter DLL for Microsoft AnswerPoint
  7. //
  8. // COMPANY: Saltmine Creative, Inc. (206)-284-7511 [email protected]
  9. //
  10. // AUTHOR: Roman Mach, Joe Mabel
  11. //
  12. // ORIGINAL DATE: 8-2-96
  13. //
  14. // NOTES:
  15. // 1.
  16. //
  17. // Version Date By Comments
  18. //--------------------------------------------------------------------
  19. // V3.0 7-21-98 JM Major revision, deprecate IDH in favor of NID, use STL.
  20. // Extract this from apgtsinf.h, apgtscac.h
  21. //
  22. #if !defined(NODESTATE_H_INCLUDED)
  23. #define APGTSINF_H_INCLUDED
  24. #if _MSC_VER >= 1000
  25. #pragma once
  26. #endif // _MSC_VER >= 1000
  27. #include<windows.h>
  28. #include <vector>
  29. using namespace std;
  30. typedef unsigned int NID; // node ID
  31. // Special node values
  32. // Please Note: nidService and nidNil are mirrored in dtguiapi.bas, please keep in sync
  33. const NID nidService = 12345;
  34. const NID nidNil = 12346;
  35. // newly introduced 7/1998
  36. const NID nidProblemPage = 12000;
  37. const NID nidByeNode = 12101;
  38. const NID nidFailNode = 12102;
  39. const NID nidImpossibleNode = 12103;
  40. const NID nidSniffedAllCausesNormalNode = 12104;
  41. typedef vector<NID> CRecommendations;
  42. // The IDHs are a deprecated feature provided only for backward compatibility on
  43. // GET method inquiries. Most IDHs are NID + 1000; there are also several special values.
  44. typedef UINT IDH;
  45. const IDH IDH_BYE = 101;
  46. const IDH IDH_FAIL = 102;
  47. const IDH idhFirst = 1000;
  48. typedef UINT IST; // state number
  49. // Special state numbers
  50. const IST ST_WORKED = 101; // Go to "Bye" Page (User succeeded)
  51. const IST ST_UNKNOWN = 102; // Unknown (user doesn't know the correct answer here - applies to
  52. // Fixable/Unfixable and Info nodes only)
  53. const IST ST_ANY = 103; // "Anything Else?"
  54. class CNodeStatePair
  55. {
  56. private:
  57. NID m_nid;
  58. IST m_state;
  59. public:
  60. CNodeStatePair(); // do not instantiate; exists only so vector can compile
  61. // the only constructor you should call is:
  62. CNodeStatePair(const NID n, const IST s) :
  63. m_nid(n), m_state(s)
  64. {};
  65. bool operator< (const CNodeStatePair &pair) const
  66. {
  67. return (m_nid < pair.m_nid || m_state < pair.m_state);
  68. }
  69. bool operator== (const CNodeStatePair &pair) const
  70. {
  71. return (m_nid == pair.m_nid && m_state == pair.m_state);
  72. }
  73. NID nid() const {return m_nid;}
  74. IST state() const {return m_state;}
  75. };
  76. typedef vector<CNodeStatePair> CBasisForInference;
  77. CBasisForInference& operator-=(CBasisForInference& lhs, const CBasisForInference& rhs);
  78. CBasisForInference& operator+=(CBasisForInference& lhs, const CBasisForInference& rhs);
  79. vector<NID>& operator-=(vector<NID>& lhs, const CBasisForInference& rhs);
  80. vector<NID>& operator+=(vector<NID>& lhs, const CBasisForInference& rhs);
  81. #endif // !defined(NODESTATE_H_INCLUDED)