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.

89 lines
2.8 KiB

  1. //
  2. // MODULE: BN.h
  3. //
  4. // PURPOSE: interface for the CBeliefNetwork class
  5. //
  6. // PROJECT: Generic Troubleshooter DLL for Microsoft AnswerPoint
  7. //
  8. // COMPANY: Saltmine Creative, Inc. (206)-284-7511 [email protected]
  9. //
  10. // AUTHOR: Joe Mabel
  11. //
  12. // ORIGINAL DATE: 8-31-98
  13. //
  14. // NOTES:
  15. // 1. Based on Print Troubleshooter DLL
  16. //
  17. // Version Date By Comments
  18. //---------------------------------------------------------------------
  19. // V3.0 8-31-98 JM
  20. //
  21. #if !defined(AFX_TOPIC_H__4ACF2F73_40EB_11D2_95EE_00C04FC22ADD__INCLUDED_)
  22. #define AFX_TOPIC_H__4ACF2F73_40EB_11D2_95EE_00C04FC22ADD__INCLUDED_
  23. #if _MSC_VER >= 1000
  24. #pragma once
  25. #endif // _MSC_VER >= 1000
  26. #include "dscread.h"
  27. #include "apgtscac.h"
  28. #include "counter.h"
  29. class CBeliefNetwork : public CDSCReader
  30. {
  31. struct SNodeType
  32. {
  33. NID Nid;
  34. ESTDLBL Type;
  35. SNodeType(NID nid, ESTDLBL type) : Nid(nid), Type(type) {}
  36. };
  37. protected:
  38. bool m_bInitialized;
  39. vector<NID> m_arrnidProblem; // NIDs of problem nodes; convenience array
  40. vector<SNodeType> m_arrNodeTypeAll; // NIDs of all nodes; convenience array
  41. CCache m_Cache; // cache for this topic
  42. CHourlyDailyCounter m_countCacheHit;
  43. CHourlyDailyCounter m_countCacheMiss;
  44. bool m_bSnifferIntegration; // This belief network is designed to integrate with a
  45. // sniffer.
  46. private:
  47. CBeliefNetwork(); // do not instantiate
  48. public:
  49. typedef enum {RS_OK, RS_Impossible, RS_Broken} eRecStatus;
  50. CBeliefNetwork(LPCTSTR path);
  51. virtual ~CBeliefNetwork();
  52. int CNode();
  53. int INode (LPCTSTR szNodeName);
  54. int GetRecommendations(
  55. const CBasisForInference & BasisForInference,
  56. CRecommendations & Recommendations);
  57. int GetProblemArray(vector<NID>* &parrnid);
  58. int GetNodeArrayIncludeType(vector<NID>& arrOut, const vector<ESTDLBL>& arrTypeInclude);
  59. int GetNodeArrayExcludeType(vector<NID>& arrOut, const vector<ESTDLBL>& arrTypeExclude);
  60. CString GetNetPropItemStr(LPCTSTR szPropName);
  61. CString GetNodePropItemStr(NID nid, LPCTSTR szPropName, IST state = 0);
  62. bool GetNetPropItemNum(LPCTSTR szPropName, double& numOut);
  63. bool GetNodePropItemNum(NID nid, LPCTSTR szPropName, double& numOut, IST state = 0);
  64. CString GetNodeSymName(NID nid);
  65. CString GetNodeFullName(NID nid);
  66. CString GetStateName(NID nid, IST state);
  67. CString GetMultilineNetProp(LPCTSTR szPropName, LPCTSTR szFormat);
  68. CString GetMultilineNodeProp(NID nid, LPCTSTR szPropName, LPCTSTR szFormat);
  69. int GetCountOfStates(NID nid);
  70. bool IsValidNID(NID nid);
  71. bool IsCauseNode(NID nid);
  72. bool IsProblemNode(NID nid);
  73. bool IsInformationalNode(NID nid);
  74. bool UsesSniffer();
  75. protected:
  76. void Initialize();
  77. BNTS * pBNTS();
  78. void ResetNodes(const CBasisForInference & BasisForInference);
  79. bool SetNodes(const CBasisForInference & BasisForInference);
  80. };
  81. #endif // !defined(AFX_TOPIC_H__4ACF2F73_40EB_11D2_95EE_00C04FC22ADD__INCLUDED_)