Record.h
1 /**************************************************************************\
2  *
3  * FILE: Record.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_RECORD_H
31 #define DIME_RECORD_H
32 
33 #include <dime/Basic.h>
34 #include <dime/Base.h>
35 #include <stdio.h>
36 
37 class dimeInput;
38 class dimeOutput;
39 
40 class DIME_DLL_API dimeRecord : public dimeBase
41 {
42 public:
43  dimeRecord(const int group_code);
44  virtual ~dimeRecord();
45 
46  virtual void setValue(const dimeParam &param, dimeMemHandler * const memhandler = NULL) = 0;
47  virtual void getValue(dimeParam &param) const = 0;
48  virtual dimeRecord *copy(dimeMemHandler * const memhandler) const = 0;
49 
50  void setGroupCode(const int group_code);
51  int getGroupCode() const;
52 
53 
54 public:
55  virtual bool isEndOfSectionRecord() const;
56  virtual bool isEndOfFileRecord() const;
57  virtual int typeId() const = 0;
58  virtual bool read(dimeInput * const in) = 0;
59  virtual bool write(dimeOutput * const out);
60  virtual void print() const {fprintf(stderr, "rec: %d\n", groupCode);}
61 
62 public:
63  static bool readRecordData(dimeInput * const in, const int group_code,
64  dimeParam &param);
65  static dimeRecord *readRecord(dimeInput * const in);
66  static dimeRecord *createRecord(const int group_code,
67  dimeMemHandler * const memhandler);
68  static dimeRecord *createRecord(const int group_code,
69  const dimeParam &param,
70  dimeMemHandler * const memhandler);
71  static int getRecordType(const int group_code);
72 
73 protected:
74  int groupCode;
75 
76 }; // class dimeRecord
77 
78 #endif // ! DIME_RECORD_H
79 

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