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

RecordHolder.h

00001 /**************************************************************************\
00002  * 
00003  *  FILE: RecordHolder.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_RECORDHOLDER_H
00031 #define DIME_RECORDHOLDER_H
00032 
00033 #include <dime/Base.h>
00034 
00035 class dimeInput;
00036 class dimeMemHandler;
00037 class dimeOutput;
00038 class dimeRecord;
00039 
00040 class DIME_DLL_API dimeRecordHolder : public dimeBase
00041 {
00042 public:
00043   dimeRecordHolder(const int separator);
00044   virtual ~dimeRecordHolder();
00045 
00046   void setRecord(const int groupcode, const dimeParam &value, 
00047                  dimeMemHandler * const memhandler = NULL);
00048   void setRecords(const int * const groupcodes,
00049                   const dimeParam * const params,
00050                   const int numrecords,
00051                   dimeMemHandler * const memhandler = NULL);
00052   void setIndexedRecord(const int groupcode, 
00053                         const dimeParam &value,
00054                         const int index,
00055                         dimeMemHandler * const memhandler = NULL);
00056   
00057   virtual bool getRecord(const int groupcode,
00058                          dimeParam &param,
00059                          const int index = 0) const;
00060   
00061   virtual bool read(dimeInput * const in);
00062   virtual bool write(dimeOutput * const out);
00063   virtual bool isOfType(const int thetypeid) const;
00064   virtual int countRecords() const;
00065 
00066   dimeRecord *findRecord(const int groupcode, const int index = 0);
00067 
00068   int getNumRecordsInRecordHolder(void) const;
00069   dimeRecord * getRecordInRecordHolder(const int idx) const;
00070 
00071 protected:
00072   virtual bool handleRecord(const int groupcode,
00073                             const dimeParam &param,
00074                             dimeMemHandler * const memhandler);
00075   
00076   bool copyRecords(dimeRecordHolder * const rh, 
00077                    dimeMemHandler * const memhandler) const;
00078 
00079   virtual bool shouldWriteRecord(const int groupcode) const;
00080 
00081 protected:
00082   dimeRecord **records;
00083   int numRecords;
00084   // int separator; // not needed ?
00085 
00086 private:
00087   void setRecordCommon(const int groupcode, const dimeParam &param,
00088                        const int index, dimeMemHandler * const memhandler);
00089 
00090 }; // class dimeRecordHolder
00091 
00092 #endif // ! DIME_RECORDHOLDER_H
00093 

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