00001 /*************************************************************************** 00002 ** 00003 ** This file is part of GeopsyCore. 00004 ** 00005 ** This library is free software; you can redistribute it and/or 00006 ** modify it under the terms of the GNU Lesser General Public 00007 ** License as published by the Free Software Foundation; either 00008 ** version 2.1 of the License, or (at your option) any later version. 00009 ** 00010 ** This file is distributed in the hope that it will be useful, but WITHOUT 00011 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00013 ** License for more details. 00014 ** 00015 ** You should have received a copy of the GNU Lesser General Public 00016 ** License along with this library; if not, write to the Free Software 00017 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 ** 00019 ** See http://www.geopsy.org for more information. 00020 ** 00021 ** Created : 2007-10-19 00022 ** Authors : 00023 ** Marc Wathelet 00024 ** Marc Wathelet (LGIT, Grenoble, France) 00025 ** 00026 ***************************************************************************/ 00027 00028 #ifndef MINISEEDRECORDS_H 00029 #define MINISEEDRECORDS_H 00030 00031 #include "MetaData.h" 00032 #include "MiniSeedSequence.h" 00033 00034 namespace GeopsyCore { 00035 00036 class MiniSeedRecords : public MetaData 00037 { 00038 public: 00039 MiniSeedRecords() {} 00040 MiniSeedRecords(const MiniSeedRecords& o) : MetaData(o), _records(o._records) {} 00041 00042 virtual const QString& xml_tagName() const {return xmlMiniSeedRecordsTag;} 00043 static const QString xmlMiniSeedRecordsTag; 00044 00045 virtual void setId(int id) const {_id=id;} 00046 virtual int id() const {return _id;} 00047 static int staticId() {return _id;} 00048 00049 virtual MetaData * clone() const {return new MiniSeedRecords(*this);} 00050 virtual const MetaData * defaultValue() const {return &_defaultValue;} 00051 00052 virtual bool storeAsXML() const {return true;} 00053 virtual bool fromString(const QString& , QString string); // Kept for compatibility 00054 00055 void add(off_t pos, quint32 byteLength); 00056 00057 int sequenceCount() const {return _records.count();} 00058 int recordCount(int sequenceIndex) const {return _records.at(sequenceIndex).count();} 00059 bool record(int sequenceIndex, int recordIndex, off_t& pos, quint32& byteLength) const; 00060 protected: 00061 virtual void xml_writeChildren(XML_WRITECHILDREN_ARGS) const; 00062 virtual XMLMember xml_member(XML_MEMBER_ARGS); 00063 virtual bool xml_setProperty(XML_SETPROPERTY_ARGS); 00064 private: 00065 QVector<MiniSeedSequence> _records; 00066 00067 static MiniSeedRecords _defaultValue; 00068 static int _id; 00069 }; 00070 00071 } // namespace GeopsyCore 00072 00073 #endif // MINISEEDRECORDS_H