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

  1. #ifndef _SELECT_H
  2. #define _SELECT_H
  3.  
  4. /*
  5. * NIST STEP Core Class Library
  6. * clstepcore/STEPselect.h
  7. * February, 1994
  8. * Dave Helfrick
  9. * KC Morris
  10.  
  11. * Development of this software was funded by the United States Government,
  12. * and is not subject to copyright.
  13. */
  14.  
  15. /* $Id: STEPselect.h,v 2.0.1.3 1994/06/06 14:48:28 kc Exp $ */
  16.  
  17.  
  18.  
  19. #include <baseType.h>
  20. #include <scl_string.h>
  21. #include <sdai.h>
  22. #include <errordesc.h>
  23. #include <read_func.h>
  24.  
  25. class TypeDescriptor;
  26. class SelectTypeDescriptor;
  27. class InstMgr;
  28.  
  29. /**********
  30.     class definition for the select superclass SdaiSelect.
  31. **********/
  32. class SdaiSelect {
  33.   protected:
  34.         const SelectTypeDescriptor *_type;
  35.         const TypeDescriptor *      underlying_type;
  36.     BASE_TYPE             base_type; // used by the subtypes
  37.  
  38.     SdaiString val;
  39.     ErrorDescriptor _error;
  40.         const TypeDescriptor * SetUnderlyingType (const TypeDescriptor *);
  41.  
  42.         const TypeDescriptor * CanBe (const char *) const;
  43.         const TypeDescriptor * CanBe (BASE_TYPE) const;
  44.     const TypeDescriptor * CanBe (const TypeDescriptor * td) const;
  45.  
  46.     virtual const TypeDescriptor * AssignEntity (STEPentity * se) =0;
  47.     virtual SdaiSelect * NewSelect () =0;
  48.   public:
  49.     Severity severity() const;
  50.     Severity severity( Severity );
  51.     const char *Error();
  52.     void Error( char * );
  53.         // clears select's error  
  54.     void ClearError();
  55.         // clears error
  56.  
  57.   // constructors
  58.         SdaiSelect (const SelectTypeDescriptor * s =0, 
  59.              const TypeDescriptor * td =0) 
  60.              : _type (s), underlying_type (td) { }
  61.  
  62.     virtual ~SdaiSelect ()    {  };
  63.  
  64.   // from SDAI binding
  65.         SdaiString UnderlyingTypeName () const;
  66.     const TypeDescriptor * CurrentUnderlyingType() const;
  67.     int exists() const;
  68.     void nullify();
  69.  
  70.     Severity SelectValidLevel(const char *attrValue, ErrorDescriptor *err, 
  71.                   InstMgr *im, int clearError);
  72.  
  73.   // reading and writing
  74.         const char * STEPwrite(SCLstring& s)  const;
  75.     void STEPwrite (ostream& out =cout) const;
  76.         virtual void STEPwrite_content (ostream& out) const =0;
  77. //    char * asStr() const;
  78.  
  79.  
  80.     Severity StrToVal(const char *val, const char *selectType, 
  81.               ErrorDescriptor *err, InstMgr * instances =0);
  82.         virtual Severity StrToVal_content (const char *, 
  83.                        InstMgr * instances =0) =0;
  84.  
  85.     Severity STEPread(istream& in, ErrorDescriptor *err, 
  86.               InstMgr * instances = 0, int addFileId =0);
  87.  
  88.         // abstract function
  89.         virtual Severity STEPread_content (istream& in =cin, 
  90.                        InstMgr * instances =0, 
  91.                        int addFileId =0) =0;
  92.  
  93. // the following functions may need changed or removed...
  94. //    SdaiSelect& operator =( SdaiSelect& ); 
  95.     int set_null();
  96.     int is_null();
  97. };    /** end class  **/
  98.  
  99. typedef SdaiSelect * SdaiSelectH ;
  100.  
  101. #endif
  102.