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 / INSTMGR.H < prev    next >
C/C++ Source or Header  |  1994-09-07  |  3KB  |  100 lines

  1.  
  2. #ifndef instmgr_h
  3. #define instmgr_h
  4.  
  5. /*
  6. * NIST STEP Editor Class Library
  7. * cleditor/instmgr.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: instmgr.h,v 2.0.1.1 1994/04/05 16:41:54 sauderd Exp $ */ 
  17.  
  18. ///// future? ////////////////
  19. // InstMgr can maintain an undo list for the last operation
  20. //    performed on a node 
  21. // InstMgr can have a startUndo() and endUndo() so it knows when to
  22. //    start a new undo list and delete the old undo list. 
  23. /////////////////////
  24.  
  25.  
  26.  
  27. typedef unsigned boolean;
  28. extern char * EntityClassName ( char *);
  29.  
  30. // IT IS VERY IMPORTANT THAT THE ORDER OF THE FOLLOWING INCLUDE FILES
  31. // BE PRESERVED
  32.  
  33. #include <gennode.h>
  34. #include <gennodelist.h>
  35. #include <gennodeinline.h>
  36. #include <gennodearray.h>
  37.  
  38. #include <mgrnode.h>
  39. #include <mgrnodelist.h>
  40.  
  41. #include <dispnode.h>
  42. #include <dispnodlist.h>
  43.  
  44. #include <mgrnodearray.h>
  45.  
  46. class InstMgr
  47. {
  48. protected:
  49.     MgrNodeArray *master;    // master array of all MgrNodes made up of
  50.             // complete, incomplete, new, delete MgrNodes lists
  51.             // this corresponds to the display list object by index
  52.     MgrNodeArraySorted *sortedMaster;    // master array sorted by fileId
  53. //    StateList *master; // this will be an sorted array of ptrs to MgrNodes
  54.  
  55.     int maxFileId;
  56.  
  57. public:
  58.     InstMgr();
  59.     ~InstMgr() {};
  60.  
  61. // MASTER LIST OPERATIONS
  62.     int InstanceCount()           { return master->Count(); }
  63.     void ClearInstances();
  64.     Severity VerifyInstances(ErrorDescriptor& e);
  65.  
  66.     // DAS PORT possible BUG two funct's below may create a temp for the cast
  67.     MgrNode *&operator[](int index)   
  68.     { return (MgrNode* &)((*master)[index]); }
  69.     MgrNode *&GetMgrNode(int index)   
  70.     { return (MgrNode* &)((*master)[index]); }
  71.  
  72.     MgrNode *FindFileId(int fileId);
  73.     // get the index into display list given a STEPentity
  74.     //  called by see initiated functions
  75.     int GetIndex(STEPentity *se);
  76.     int GetIndex(MgrNode *mn);
  77.     int VerifyEntity(int fileId, const char *expectedType);
  78.  
  79. //    void Append(MgrNode *node);
  80.     MgrNode *Append(STEPentity *se, stateEnum listState);
  81.         // deletes node from master list structure 
  82.     void Delete(MgrNode *node);
  83.     void Delete(STEPentity *se);
  84.  
  85.     void ChangeState(MgrNode *node, stateEnum listState);
  86.  
  87.     int MaxFileId()        { return maxFileId; }
  88.     int NextFileId()        { return maxFileId = maxFileId +1; }
  89.     int EntityKeywordCount(const char* name);
  90.     STEPentity *GetSTEPentity(int index);
  91.     STEPentity *GetSTEPentity(const char* entityKeyword,int starting_index);
  92.     STEPentity *GetSTEPentity(MgrNode *node) 
  93.                     { return node->GetSTEPentity(); };
  94.     void *GetSEE(int index);
  95.     void *GetSEE(MgrNode *node) { return node->SEE(); };
  96.  
  97. };
  98.  
  99. #endif
  100.