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.

57 lines
1.7 KiB

  1. #include <parmdefs.h>
  2. #include <ql.h>
  3. #include <sync.h>
  4. #include <limits.h>
  5. #include <sortarr.h>
  6. #ifndef __WBEM_EVALUTAION_TREE__H_
  7. #define __WBEM_EVALUTAION_TREE__H_
  8. class CConjunction
  9. {
  10. protected:
  11. CUniquePointerArray<QL_LEVEL_1_TOKEN> m_apTokens;
  12. public:
  13. CConjunction(QL_LEVEL_1_TOKEN& Token, BOOL bNegate);
  14. CConjunction(CConjunction& Other);
  15. CConjunction(CConjunction& Other1, CConjunction& Other2);
  16. long GetNumTokens() {return m_apTokens.GetSize();}
  17. INTERNAL QL_LEVEL_1_TOKEN* GetTokenAt(int nIndex)
  18. {return m_apTokens[nIndex];}
  19. void AddToken(ACQUIRE QL_LEVEL_1_TOKEN* pNew)
  20. {m_apTokens.Add(pNew);}
  21. // HRESULT BuildTree(CContextMetaData* pNamespace,
  22. // CImplicationList& Implications,
  23. // CEvalNode** ppRes);
  24. void Sort();
  25. static int NegateOperator(int nOperator);
  26. };
  27. class CDNFExpression
  28. {
  29. protected:
  30. CUniquePointerArray<CConjunction> m_apTerms;
  31. protected:
  32. void CreateFromToken(QL_LEVEL_1_TOKEN& Token, BOOL bNegate = FALSE);
  33. void CreateOr(CDNFExpression& Arg1, CDNFExpression& Arg2);
  34. void CreateAnd(CDNFExpression& Arg1, CDNFExpression& Arg2);
  35. public:
  36. long GetNumTerms() {return m_apTerms.GetSize();}
  37. INTERNAL CConjunction* GetTermAt(int nIndex)
  38. {return m_apTerms[nIndex];}
  39. void AddTerm(ACQUIRE CConjunction* pNew)
  40. {m_apTerms.Add(pNew);}
  41. // HRESULT BuildTree(CContextMetaData* pNamespace,
  42. // CImplicationList& Implications,
  43. // CEvalNode** ppRes);
  44. void CreateFromTokens(QL_LEVEL_1_TOKEN*& pLastToken, BOOL bNegate = FALSE);
  45. void Sort();
  46. };
  47. #endif