All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions | Static Public Attributes
GeopsyCore::MiniSeedSequence Class Reference

Brief description of class still missing. More...

#include <MiniSeedSequence.h>

Inheritance diagram for GeopsyCore::MiniSeedSequence:
QGpCoreTools::XMLClass

List of all members.

Public Member Functions

bool add (off_t pos, quint32 byteLength)
quint32 byteLength () const
int count () const
 MiniSeedSequence ()
 MiniSeedSequence (const MiniSeedSequence &o)
off_t pos (int index) const
void setByteLength (quint32 b)
void setFirstPos (off_t p)
virtual void xml_attributes (XML_ATTRIBUTES_ARGS) const
virtual bool xml_setAttributes (XML_SETATTRIBUTES_ARGS)
virtual const QString & xml_tagName () const
 ~MiniSeedSequence ()

Static Public Attributes

static const QString xmlMiniSeedSequenceTag = "Sequence"

Detailed Description

Brief description of class still missing.

A sequence of Mini Seed records


Constructor & Destructor Documentation

Description of constructor still missing

    : XMLClass()
  {
    _count=1;
    _firstPos=0;
    _increment=0;
    _byteLength=0;
  }

Description of constructor still missing

    : XMLClass()
  {
    _count=o._count;
    _firstPos=o._firstPos;
    _increment=o._increment;
    _byteLength=o._byteLength;
  }
{}

Member Function Documentation

bool GeopsyCore::MiniSeedSequence::add ( off_t  pos,
quint32  byteLength 
)

Returns true if the record at position pos with length byteLength can be added to this sequence. If so, the record is added to the sequence.

References pos().

  {
    if(_byteLength==byteLength) {
      if(_increment==0) {
        if(pos>_firstPos) {
          _increment=pos-_firstPos;
          _count++;
          return true;
        }
      } else if(pos==MiniSeedSequence::pos(_count)) {
        _count++;
        return true;
      }
    }
    return false;
  }
quint32 GeopsyCore::MiniSeedSequence::byteLength ( ) const [inline]

Referenced by GeopsyCore::MiniSeedRecords::record().

{return _byteLength;}
int GeopsyCore::MiniSeedSequence::count ( ) const [inline]

Referenced by GeopsyCore::MiniSeedRecords::record().

{return _count;}
off_t GeopsyCore::MiniSeedSequence::pos ( int  index) const [inline]

Referenced by add(), and GeopsyCore::MiniSeedRecords::record().

{return _firstPos+index*_increment;}
void GeopsyCore::MiniSeedSequence::setByteLength ( quint32  b) [inline]

Referenced by GeopsyCore::MiniSeedRecords::add().

{_byteLength=b;}
void GeopsyCore::MiniSeedSequence::setFirstPos ( off_t  p) [inline]

Referenced by GeopsyCore::MiniSeedRecords::add().

{_firstPos=p;}

Reimplemented from QGpCoreTools::XMLClass.

References TRACE.

  {
    TRACE;
    Q_UNUSED(context);
    static const QString keys[]={"count", "firstPos", "increment", "byteLength"};
    attributes.add(keys[0], QString::number(_count));
    attributes.add(keys[1], QString::number(_firstPos));
    attributes.add(keys[2], QString::number(_increment));
    attributes.add(keys[3], QString::number(_byteLength));
  }

Reimplemented from QGpCoreTools::XMLClass.

References QGpCoreTools::StringSection::size(), and TRACE.

  {
    TRACE;
    Q_UNUSED(context);
    for(XMLRestoreAttributeIterator it=attributes.begin(); it!= attributes.end(); it++ ) {
      const StringSection& att=it.key();
      if(att.size()<1) return false;
      switch (att[0].unicode()) {
      case 'c':
        if(att=="count") _count=it.value().toInt(); else return false;
        break;
      case 'b':
        if(att=="byteLength") _byteLength=it.value().toInt(); else return false;
        break;
      case 'f':
        if(att=="firstPos") _firstPos=it.value().toLongLong(); else return false;
        break;
      case 'i':
        if(att=="increment") _increment=it.value().toLongLong(); else return false;
        break;
      default:
        return false;
      }
    }
    return true;
  }
virtual const QString& GeopsyCore::MiniSeedSequence::xml_tagName ( ) const [inline, virtual]

Member Data Documentation

const QString GeopsyCore::MiniSeedSequence::xmlMiniSeedSequenceTag = "Sequence" [static]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines