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 / SENTITY.H < prev    next >
C/C++ Source or Header  |  1994-08-06  |  3KB  |  113 lines

  1. #ifndef SENTITY_H
  2. #define    SENTITY_H 1
  3.  
  4. /*
  5. * NIST STEP Core Class Library
  6. * clstepcore/STEPentity.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: STEPentity.h,v 2.0.1.2 1994/05/10 21:03:10 kc Exp $ */
  16.  
  17.  
  18.  
  19. #include <stdio.h>
  20. #include <att_List.h>
  21. #include <sdai.h>
  22.  
  23. class STEPattributeList;
  24. class STEPattribute;
  25.  
  26. #include <ctype.h>
  27. #include <Str.h>
  28.  
  29. class InstMgr;
  30. class EntityDescriptor;
  31.  
  32. ///////////////////////////////////////////////////////////////////////////////
  33.  
  34. class STEPentity  {
  35.   private:
  36.     int _cur;    // provides a built-in way of accessing attributes in order.
  37.     
  38.  protected:
  39.   STEPattribute * GetSTEPattribute (const char *);
  40.   STEPattribute * MakeDerived (const char *);
  41.  
  42.  public:
  43.     STEPattributeList attributes;
  44.     int           STEPfile_id;
  45.     ErrorDescriptor   _error;
  46.                     // registry additions - DEL
  47.     EntityDescriptor *EntityDescriptor;
  48.     
  49.  public:
  50.     STEPentity ();
  51.     virtual ~STEPentity();
  52.  
  53.     int SetFileId(int fid) { return STEPfile_id = fid; }
  54.     int GetFileId() const  { return STEPfile_id; }
  55.     int FileId (int fid) { return STEPfile_id = fid; }
  56.     int FileId() const  { return STEPfile_id; }
  57.  
  58.     const char *EntityName() const { return EntityDescriptor->Name(); }
  59.  
  60.     enum Severity ValidLevel(ErrorDescriptor *error, InstMgr *im, 
  61.             int clearError = 1);
  62.     ErrorDescriptor &Error()    { return _error; }
  63.         // clears entity's error and optionally all attr's errors
  64.     void ClearError(int clearAttrs = 1);
  65.         // clears all attr's errors
  66.     void ClearAttrError();
  67. //    void EnforceOptionality(int on = 1);
  68.  
  69.     STEPentity *Replicate();
  70.  
  71. // ACCESS attributes in order.
  72.     int AttributeCount();
  73.     STEPattribute * NextAttribute();
  74.     void ResetAttributes()        { _cur =0; }
  75.     
  76. // READ
  77.     enum Severity STEPread(int id, int addFileId, class InstMgr * instance_set,
  78.          istream& in =cin);
  79.     void STEPread_error(char c, int index, istream& in);
  80.  
  81. // WRITE
  82.     void STEPwrite(ostream& out =cout);
  83.     const char * STEPwrite(SCLstring &buf);
  84.  
  85.     void     STEPwrite_reference (ostream& out =cout);
  86.     const char * STEPwrite_reference (SCLstring &buf);
  87.  
  88.     void beginSTEPwrite(ostream& out =cout); // writes out the SCOPE section
  89.     void endSTEPwrite(ostream& out =cout);
  90.  
  91.   protected:
  92.     void CopyAs (STEPentity *);
  93. }
  94. ;
  95.  
  96. ///////////////////////////////////////////////////////////////////////////////
  97.  
  98. extern STEPentity NilSTEPentity;
  99. #define ENTITY_NULL    &NilSTEPentity
  100. #define NULL_ENTITY    &NilSTEPentity
  101.  
  102. typedef STEPentity* STEPentityPtr;
  103. typedef STEPentity* STEPentityH;
  104.  
  105. extern STEPentity *
  106. ReadEntityRef(istream &in, ErrorDescriptor *err, char *tokenList, 
  107.           InstMgr * instances, int addFileId);
  108.  
  109. //typedef  STEPentity * (* Creator) () const;
  110. //typedef  STEPentity * (* Creator) () ;
  111.  
  112. #endif
  113.