Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

Class.h

00001 /**************************************************************************\
00002  * 
00003  *  FILE: Class.h
00004  *
00005  *  This source file is part of DIME.
00006  *  Copyright (C) 1998-1999 by Systems In Motion.  All rights reserved.
00007  *
00008  *  This library is free software; you can redistribute it and/or modify it
00009  *  under the terms of the GNU General Public License, version 2, as
00010  *  published by the Free Software Foundation.
00011  *
00012  *  This library is distributed in the hope that it will be useful, but
00013  *  WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  *  General Public License (the accompanying file named COPYING) for more
00016  *  details.
00017  *
00018  **************************************************************************
00019  *
00020  *  If you need DIME for a non-GPL project, contact Systems In Motion
00021  *  to acquire a Professional Edition License:
00022  *
00023  *  Systems In Motion                                   http://www.sim.no/
00024  *  Prof. Brochs gate 6                                       sales@sim.no
00025  *  N-7030 Trondheim                                   Voice: +47 22114160
00026  *  NORWAY                                               Fax: +47 67172912
00027  *
00028 \**************************************************************************/
00029 
00030 #ifndef DIME_CLASS_H
00031 #define DIME_CLASS_H
00032 
00033 #include <dime/Base.h>
00034 #include <dime/Basic.h>
00035 #include <dime/util/Array.h>
00036 #include <dime/util/Linear.h>
00037 #include <dime/RecordHolder.h>
00038 
00039 class dimeInput;
00040 class dimeMemHandler;
00041 class dimeModel;
00042 class dimeOutput;
00043 
00044 class DIME_DLL_API dimeClass : public dimeRecordHolder
00045 {
00046   friend class dimeClassesSection;
00047   friend class dimeModel;
00048   
00049 public:
00050   dimeClass();
00051   virtual ~dimeClass();
00052   
00053   virtual const char *getDxfClassName() const = 0;  
00054   virtual dimeClass *copy(dimeModel * const model) const = 0; 
00055   virtual bool read(dimeInput * const in);
00056   virtual bool write(dimeOutput * const out);
00057   virtual bool isOfType(const int thetypeid) const;
00058   virtual int countRecords() const;
00059 
00060   const char *getClassName() const;
00061   const char *getApplicationName() const;
00062   int32 getVersionNumber() const;
00063   int8 getFlag280() const;
00064   int8 getFlag281() const;
00065 
00066   void setClassName(const char * const classname, 
00067                     dimeMemHandler * const memhandler = NULL);
00068   void setApplicationName(const char * const appname, 
00069                           dimeMemHandler * const memhandler = NULL);
00070   void setVersionNumber(const int32 v);
00071   void setFlag280(const int8 flag);
00072   void setFlag281(const int8 flag);
00073 
00074 protected:
00075   virtual bool handleRecord(const int groupcode,
00076                             const dimeParam &param,
00077                             dimeMemHandler * const memhandler);
00078   
00079 public:
00080   static dimeClass *createClass(const char * const name,
00081                                dimeMemHandler * const memhandler = NULL);    
00082 protected:
00083   bool copyRecords(dimeClass * const newclass, dimeModel * const model) const;
00084 
00085 private:
00086   char *className;
00087   char *appName;
00088   int32 versionNumber;
00089   int8 flag1;
00090   int8 flag2;
00091 
00092 }; // class dimeClass
00093 
00094 inline const char *
00095 dimeClass::getClassName() const
00096 {
00097   return this->className;
00098 }
00099 
00100 inline const char *
00101 dimeClass::getApplicationName() const
00102 {
00103   return this->appName;
00104 }
00105 
00106 inline int32 
00107 dimeClass::getVersionNumber() const
00108 {
00109   return this->versionNumber;
00110 }
00111 
00112 inline int8 
00113 dimeClass::getFlag280() const
00114 {
00115   return this->flag1;
00116 }
00117 
00118 inline int8 
00119 dimeClass::getFlag281() const
00120 {
00121   return this->flag2;
00122 }
00123 
00124 inline void 
00125 dimeClass::setVersionNumber(const int32 v)
00126 {
00127   this->versionNumber = v;
00128 }
00129 
00130 inline void 
00131 dimeClass::setFlag280(const int8 flag)
00132 {
00133   this->flag1 = flag;
00134 }
00135 
00136 inline void 
00137 dimeClass::setFlag281(const int8 flag)
00138 {
00139   this->flag2 = flag;
00140 }
00141 
00142 #endif // ! DIME_CLASS_H
00143 

Copyright © 1998-1999, Systems In Motion <sales@sim.no>. All rights reserved.
System documentation was generated using doxygen.