Class.h
1 /**************************************************************************\
2  *
3  * FILE: Class.h
4  *
5  * This source file is part of DIME.
6  * Copyright (C) 1998-1999 by Systems In Motion. All rights reserved.
7  *
8  * This library is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License, version 2, as
10  * published by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License (the accompanying file named COPYING) for more
16  * details.
17  *
18  **************************************************************************
19  *
20  * If you need DIME for a non-GPL project, contact Systems In Motion
21  * to acquire a Professional Edition License:
22  *
23  * Systems In Motion http://www.sim.no/
24  * Prof. Brochs gate 6 sales@sim.no
25  * N-7030 Trondheim Voice: +47 22114160
26  * NORWAY Fax: +47 67172912
27  *
28 \**************************************************************************/
29 
30 #ifndef DIME_CLASS_H
31 #define DIME_CLASS_H
32 
33 #include <dime/Base.h>
34 #include <dime/Basic.h>
35 #include <dime/util/Array.h>
36 #include <dime/util/Linear.h>
37 #include <dime/RecordHolder.h>
38 
39 class dimeInput;
40 class dimeMemHandler;
41 class dimeModel;
42 class dimeOutput;
43 
44 class DIME_DLL_API dimeClass : public dimeRecordHolder
45 {
46  friend class dimeClassesSection;
47  friend class dimeModel;
48 
49 public:
50  dimeClass();
51  virtual ~dimeClass();
52 
53  virtual const char *getDxfClassName() const = 0;
54  virtual dimeClass *copy(dimeModel * const model) const = 0;
55  virtual bool read(dimeInput * const in);
56  virtual bool write(dimeOutput * const out);
57  virtual bool isOfType(const int thetypeid) const;
58  virtual int countRecords() const;
59 
60  const char *getClassName() const;
61  const char *getApplicationName() const;
62  int32 getVersionNumber() const;
63  int8 getFlag280() const;
64  int8 getFlag281() const;
65 
66  void setClassName(const char * const classname,
67  dimeMemHandler * const memhandler = NULL);
68  void setApplicationName(const char * const appname,
69  dimeMemHandler * const memhandler = NULL);
70  void setVersionNumber(const int32 v);
71  void setFlag280(const int8 flag);
72  void setFlag281(const int8 flag);
73 
74 protected:
75  virtual bool handleRecord(const int groupcode,
76  const dimeParam &param,
77  dimeMemHandler * const memhandler);
78 
79 public:
80  static dimeClass *createClass(const char * const name,
81  dimeMemHandler * const memhandler = NULL);
82 protected:
83  bool copyRecords(dimeClass * const newclass, dimeModel * const model) const;
84 
85 private:
86  char *className;
87  char *appName;
88  int32 versionNumber;
89  int8 flag1;
90  int8 flag2;
91 
92 }; // class dimeClass
93 
94 inline const char *
96 {
97  return this->className;
98 }
99 
100 inline const char *
102 {
103  return this->appName;
104 }
105 
106 inline int32
108 {
109  return this->versionNumber;
110 }
111 
112 inline int8
114 {
115  return this->flag1;
116 }
117 
118 inline int8
120 {
121  return this->flag2;
122 }
123 
124 inline void
126 {
127  this->versionNumber = v;
128 }
129 
130 inline void
131 dimeClass::setFlag280(const int8 flag)
132 {
133  this->flag1 = flag;
134 }
135 
136 inline void
137 dimeClass::setFlag281(const int8 flag)
138 {
139  this->flag2 = flag;
140 }
141 
142 #endif // ! DIME_CLASS_H
143 

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