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.

84 lines
1.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1997
  6. //
  7. // File: gnodera.hxx
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef __gnodera_hxx__
  11. #define __gnodera_hxx__
  12. #include "gelem.h"
  13. #include "types.hxx"
  14. class GNODERA;
  15. // class GNODERA: node with dynamic array of children and
  16. // parents for fast random access.
  17. class GNODERA : public GNODE
  18. {
  19. public:
  20. GNODERA();
  21. virtual ~GNODERA();
  22. virtual GEDGE*& PedgeSource();
  23. virtual GEDGE*& PedgeSink();
  24. virtual GEDGE* PedgeSource() const;
  25. virtual GEDGE* PedgeSink() const;
  26. virtual UINT CSourceArc() const;
  27. virtual UINT CSinkArc() const;
  28. UINT CnodeChild();
  29. UINT CnodeParent();
  30. VPGNODE& VpnodeChild() { return _vpnodeChild; }
  31. // Insert a child/parent in position iChild/iParent
  32. VOID InsertChild(UINT inodeChild, GNODE* pnodeChild);
  33. VOID InsertParent(UINT inodeParent, GNODE* pnodeParent);
  34. // Insert a child/parent at the end of the child/parent vector
  35. VOID InsertChild(GNODE* pnodeChild);
  36. VOID InsertParent(GNODE* pnodeParent);
  37. // Delete the child/parent in position iChild/iParent
  38. VOID DeleteChild(UINT inodeChild);
  39. VOID DeleteParent(UINT inodeParent);
  40. // Test Child/Parent membership
  41. BOOL BChild(GNODE* pnode);
  42. BOOL BParent(GNODE* pnode);
  43. UINT InodeChild(GNODE* pnode);
  44. UINT InodeParent(GNODE* pnode);
  45. GNODE* PnodeParent(UINT inodeParent);
  46. GNODE* PnodeChild(UINT inodeChild);
  47. GNODERA* PnoderaParent(UINT inodeParent);
  48. GNODERA* PnoderaChild(UINT inodeChild);
  49. protected:
  50. virtual GEDGE* PedgeOrdering(GEDGE * pgedge, BOOL bSource);
  51. virtual VOID ArcDeath(GEDGE * pgedge, BOOL bSource);
  52. protected:
  53. GEDGLNK _glkArcs;
  54. VPGNODE _vpnodeChild;
  55. VPGNODE _vpnodeParent;
  56. };
  57. #endif