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.

77 lines
2.2 KiB

  1. #ifndef _OIDTREESCANNER_HPP
  2. #define _OIDTREESCANNER_HPP
  3. class Oid;
  4. class OidTreeScanner
  5. {
  6. protected:
  7. SIMCOidTree *m_pOidTree;
  8. // DESCRIPTION:
  9. // Adds list of nodes from lstChildren to the tail of m_recursionTrace,
  10. // constructing at the same time the OID lexicographically order.
  11. // the list received as parameter should not be modified;
  12. // PARAMETERS:
  13. // (in) list of nodes to add
  14. void UpdateRecursionTrace(SIMCNodeList *pLstChildren, SIMCNodeList *pLstTrace);
  15. // DESCRIPTION:
  16. // Gets the first symbol from the symbol list of the node pOidNode
  17. // PARAMETERS:
  18. // (in) pOidNode whose symbol is to be returned
  19. // (out) cszSymbol - pointer to the symbol (do not alter or free)
  20. // RETURN VALUE:
  21. // 0 on success, -1 on failure
  22. int GetNodeSymbol(const SIMCOidTreeNode *pOidNode, const char * & cszSymbol);
  23. // DESCRIPTION:
  24. // Gets the complete OID information for the given pOidNode.
  25. // It supplies both the numeric value and symbolic name for each
  26. // component of the OID.
  27. // PARAMETERS:
  28. // (in) pOidNode - the node whose OID is to be found
  29. // (out) oid - the Oid object who stores the data
  30. // RETURN VALUE:
  31. // 0 on success, -1 on failure
  32. int GetNodeOid(const SIMCOidTreeNode *pOidNode, Oid &oid);
  33. public:
  34. // initializes the OidTreeScanner
  35. OidTreeScanner();
  36. // DESCRIPTION:
  37. // scans lexicographically the oid tree;
  38. // RETURN VALUE:
  39. // 0 on success
  40. // -1 on failure;
  41. virtual int Scan();
  42. // DESCRIPTION:
  43. // "callback" function, called each time a
  44. // tree node passes through the scan. The user
  45. // should redefine this function in the derived
  46. // object to perform the action desired.
  47. // PARAMETERS:
  48. // (in) Pointer to the current node in the tree.
  49. // RETURN VALUE:
  50. // 0 - the scanner should continue
  51. // 1 - the scanner should abort.
  52. virtual int OnScanNode(const SIMCOidTreeNode *pOidNode) = 0;
  53. // DESCRIPTION:
  54. // Fills the symbols of the built-in objects from the static table
  55. // RETURN VALUE:
  56. // 0 - on success, -1 on failure
  57. int MergeBuiltIn();
  58. // DESCRIPTION:
  59. // initializes the m_pOidTree.
  60. // PARAMETERS:
  61. // (in) pointer to the SIMCOidTree to scan.
  62. void SetOidTree(SIMCOidTree *pOidTree);
  63. ~OidTreeScanner();
  64. };
  65. #endif