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 / REGISTRY.H < prev    next >
C/C++ Source or Header  |  1994-08-06  |  2KB  |  65 lines

  1. #ifndef _REGISTRY_H
  2. #define _REGISTRY_H
  3.  
  4. /*
  5. * NIST STEP Core Class Library
  6. * clstepcore/Registry.h
  7. * February, 1994
  8. * K. C. Morris
  9. * David Sauder
  10.  
  11. * Development of this software was funded by the United States Government,
  12. * and is not subject to copyright.
  13. */
  14.  
  15. /* $Id: Registry.h,v 2.0.1.2 1994/05/10 21:01:34 kc Exp $  */ 
  16.  
  17. #include <Sentity.h>
  18. #include <errordesc.h>
  19. #include <scl_hash.h>
  20. typedef struct Hash_Table * HashTable;
  21.  
  22. class Registry;
  23. extern char * EntityClassName ( char *);
  24. typedef void (* CF_init) (Registry &);    //  pointer to creation initialization 
  25.  
  26. class Registry {
  27.   protected:
  28.     HashTable primordialSwamp;    //  dictionary of EntityDescriptors
  29.     HashTable active_schemas;    //  dictionary of SchemaDescriptors
  30.     HashTable active_types;    //  dictionary of TypeDescriptors
  31.     
  32.     int entity_cnt;
  33.     HashEntry     cur_entity;
  34.     HashEntry     cur_schema;
  35.  
  36.   public:
  37.     Registry (CF_init initFunct);
  38.     ~Registry ();
  39.     void DeleteContents ();  // CAUTION: calls delete on all the descriptors 
  40.  
  41.     const EntityDescriptor* FindEntity (const char *, int check_case =1) const;
  42.     const SchemaDescriptor* FindSchema (const char *, int check_case =1) const;
  43.     const TypeDescriptor*   FindType (const char *, int check_case =1) const;
  44.     
  45.     void     AddEntity (const EntityDescriptor&);
  46.     void    AddSchema (const SchemaDescriptor&);
  47.     void     AddType  (const TypeDescriptor&);
  48.     
  49.     void     RemoveEntity (const char *);
  50.     void    RemoveSchema (const char *);
  51.     void     RemoveType (const char *);
  52.  
  53.     int     GetEntityCnt ();
  54.     void    ResetEntities ();
  55.     const EntityDescriptor *    NextEntity ();
  56.     
  57.     void    ResetSchemas ()  ;
  58.     const SchemaDescriptor *    NextSchema ();
  59.  
  60.     STEPentity* ObjCreate (const char * nm, int check_case =1) const;
  61.     
  62. };
  63.  
  64. #endif  //_REGISTRY_H
  65.