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.

89 lines
2.1 KiB

  1. //
  2. // MODULE: SNIFF.H
  3. //
  4. // PURPOSE: sniffed data container
  5. //
  6. // PROJECT: Generic Troubleshooter DLL for Microsoft AnswerPoint
  7. //
  8. // COMPANY: Saltmine Creative, Inc. (206)-633-4743 [email protected]
  9. //
  10. // AUTHOR: Oleg Kalosha
  11. //
  12. // ORIGINAL DATE: 3-27-99
  13. //
  14. // NOTES:
  15. // 1. Based on Print Troubleshooter DLL
  16. //
  17. // Version Date By Comments
  18. //--------------------------------------------------------------------
  19. // V0.1 - RM Original
  20. // V0.2 6/4/97 RWM Local Version for Memphis
  21. // V0.3 3/24/98 JM Local Version for NT5
  22. #ifndef TSHOOT_SNIFF_H
  23. #define TSHOOT_SNIFF_H
  24. #define SNIFF_INVALID_NODE_ID -1
  25. #define SNIFF_INVALID_STATE -1
  26. #define SNIFF_INVALID_NODE_LABEL -1
  27. //////////////////////////////////////////////////////////////////////////////////////
  28. // CSniffedNodeInfo struct
  29. //
  30. struct CSniffedNodeInfo
  31. {
  32. CSniffedNodeInfo()
  33. : m_iState(SNIFF_INVALID_STATE),
  34. m_iId(SNIFF_INVALID_NODE_ID),
  35. m_iLabel(SNIFF_INVALID_NODE_LABEL)
  36. {}
  37. CSniffedNodeInfo(CString& name, int state)
  38. : m_strName(name),
  39. m_iState(state),
  40. m_iId(SNIFF_INVALID_NODE_ID),
  41. m_iLabel(SNIFF_INVALID_NODE_LABEL)
  42. {}
  43. int m_iId; // node id
  44. int m_iState; // node state (sniffed)
  45. int m_iLabel; // node label
  46. CString m_strName; // node symbolic name
  47. };
  48. //////////////////////////////////////////////////////////////////////////////////////
  49. // CSniffedContainer class declaration
  50. //
  51. class GTSAPI;
  52. class CSniffedNodeContainer
  53. {
  54. public:
  55. CSniffedNodeContainer();
  56. CSniffedNodeContainer(GTSAPI*);
  57. virtual ~CSniffedNodeContainer();
  58. // interface
  59. GTSAPI* GetBNTS();
  60. void SetBNTS(GTSAPI* bnts);
  61. bool AddNode(CString name, int state);
  62. bool ResetIds(); // should be called if we (re)set BNTS
  63. bool HasNode(int id);
  64. CSniffedNodeInfo* GetInfo(int id);
  65. bool GetState(int id, int* state);
  66. bool GetLabel(int id, int* label);
  67. bool IsEmpty();
  68. void Flush();
  69. int GetSniffedFixobsThatWorked();
  70. protected:
  71. bool GetLabelFromBNTS(int node, int* label);
  72. protected:
  73. GTSAPI* m_pBNTS; // pointer to BNTS (or inherited class)
  74. CArray<CSniffedNodeInfo, CSniffedNodeInfo&> m_arrInfo; // data array
  75. };
  76. #endif