RecordHolder.h
1 /**************************************************************************\
2  *
3  * FILE: RecordHolder.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_RECORDHOLDER_H
31 #define DIME_RECORDHOLDER_H
32 
33 #include <dime/Base.h>
34 
35 class dimeInput;
36 class dimeMemHandler;
37 class dimeOutput;
38 class dimeRecord;
39 
40 class DIME_DLL_API dimeRecordHolder : public dimeBase
41 {
42 public:
43  dimeRecordHolder(const int separator);
44  virtual ~dimeRecordHolder();
45 
46  void setRecord(const int groupcode, const dimeParam &value,
47  dimeMemHandler * const memhandler = NULL);
48  void setRecords(const int * const groupcodes,
49  const dimeParam * const params,
50  const int numrecords,
51  dimeMemHandler * const memhandler = NULL);
52  void setIndexedRecord(const int groupcode,
53  const dimeParam &value,
54  const int index,
55  dimeMemHandler * const memhandler = NULL);
56 
57  virtual bool getRecord(const int groupcode,
58  dimeParam &param,
59  const int index = 0) const;
60 
61  virtual bool read(dimeInput * const in);
62  virtual bool write(dimeOutput * const out);
63  virtual bool isOfType(const int thetypeid) const;
64  virtual int countRecords() const;
65 
66  dimeRecord *findRecord(const int groupcode, const int index = 0);
67 
68  int getNumRecordsInRecordHolder(void) const;
69  dimeRecord * getRecordInRecordHolder(const int idx) const;
70 
71 protected:
72  virtual bool handleRecord(const int groupcode,
73  const dimeParam &param,
74  dimeMemHandler * const memhandler);
75 
76  bool copyRecords(dimeRecordHolder * const rh,
77  dimeMemHandler * const memhandler) const;
78 
79  virtual bool shouldWriteRecord(const int groupcode) const;
80 
81 protected:
82  dimeRecord **records;
83  int numRecords;
84  // int separator; // not needed ?
85 
86 private:
87  void setRecordCommon(const int groupcode, const dimeParam &param,
88  const int index, dimeMemHandler * const memhandler);
89 
90 }; // class dimeRecordHolder
91 
92 #endif // ! DIME_RECORDHOLDER_H
93 

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