home *** CD-ROM | disk | FTP | other *** search
/ ftptest.leeds.ac.uk / 2015.02.ftptest.leeds.ac.uk.tar / ftptest.leeds.ac.uk / bionet / CAE-GROUP / SCL-WIN3x / SCL.EXE / MGRNODEA.H < prev    next >
C/C++ Source or Header  |  1994-10-03  |  3KB  |  101 lines

  1.  
  2. #ifndef mgrnodearray_h
  3. #define mgrnodearray_h
  4.  
  5. /*
  6. * NIST STEP Editor Class Library
  7. * cleditor/mgrnodearray.h
  8. * February, 1994
  9. * David Sauder
  10. * K. C. Morris
  11.  
  12. * Development of this software was funded by the United States Government,
  13. * and is not subject to copyright.
  14. */
  15.  
  16. /* $Id: mgrnodearray.h,v 2.0.1.1 1994/04/05 16:41:59 sauderd Exp $ */ 
  17.  
  18.  
  19. #include <string.h>
  20.  
  21. #include <gennode.h>
  22. #include <gennodelist.h>
  23. #include <gennodeinline.h>
  24.  
  25. #include <mgrnode.h>
  26. #include <mgrnodelist.h>
  27.  
  28. #include <gennodearray.h>
  29.  
  30. #define ARRAY_DEFAULT_SIZE (1024)
  31.  
  32. //////////////////////////////////////////////////////////////////////////////
  33. // class MgrNodeArray
  34. // This class implements the array of MgrNodes representing the
  35. // master list for the seInstMgr which will have a one to one
  36. // mapping by index to the display list of corresponding STEPentities.
  37. // If you delete this object it deletes all of the entries it points to.
  38. //////////////////////////////////////////////////////////////////////////////
  39.  
  40. class MgrNodeArray : public GenNodeArray
  41. {
  42. public:
  43.     MgrNodeArray(int defaultSize = ARRAY_DEFAULT_SIZE) 
  44.     : GenNodeArray(defaultSize) { }
  45.     ~MgrNodeArray();
  46.  
  47. // REDEFINED functions
  48.     // need to redefine Append() & Insert(GenericNode *) so they call 
  49.     //    MgrNodeArray::Insert(GenericNode *, int index);
  50.     virtual int Insert(GenericNode* gn, int index);
  51.     virtual void Append(GenericNode* gn)    { Insert(gn, _count); }
  52.     virtual int Insert(GenericNode* gn)        { return Insert(gn, _count); }
  53.     virtual void Remove(int index);
  54.     virtual void ClearEntries();
  55.     virtual void DeleteEntries();
  56.  
  57. // ADDED functions
  58.     virtual int MgrNodeIndex(int fileId);
  59.     void AssignIndexAddress(int index);
  60. };
  61.  
  62. //////////////////////////////////////////////////////////////////////////////
  63. // class MgrNodeArraySorted
  64. // This class implements the array of MgrNodes representing the
  65. // sorted master list for the seInstMgr.  This list is sorted by
  66. // STEPentity::fileId.
  67. // If you delete this object it won't delete the entries it points to.
  68. //////////////////////////////////////////////////////////////////////////////
  69.  
  70. class MgrNodeArraySorted : public GenNodeArray {
  71. public:
  72.     MgrNodeArraySorted(int defaultSize = ARRAY_DEFAULT_SIZE) 
  73.     : GenNodeArray(defaultSize) {}
  74.     ~MgrNodeArraySorted() { }
  75.  
  76. // REDEFINED functions
  77.     virtual int Index(GenericNode* gn);
  78.     virtual int Index(GenericNode** gn);
  79.  
  80.     virtual int Insert(GenericNode* gn);
  81.     virtual int Insert(GenericNode* gn, int index) 
  82.     { cerr << 
  83.       "Call MgrNodeArraySorted::Insert() without index argument instead.\n"
  84.         << "index argument: " << index << " being ignored.\n";
  85.       return Insert(gn); }
  86.     virtual void Append(GenericNode* gn)        { Insert(gn); }
  87.     virtual void ClearEntries();
  88.     virtual void DeleteEntries();
  89.  
  90. // ADDED functions
  91.     virtual int MgrNodeIndex(int fileId);
  92.     int FindInsertPosition (const int fileId);
  93. };
  94.  
  95.  
  96. //////////////////////////////////////////////////////////////////////////////
  97. // class MgrNodeArray inline public functions
  98. //////////////////////////////////////////////////////////////////////////////
  99.  
  100. #endif
  101.