Public Member Functions | Static Public Member Functions
CurveMaxEntry Class Reference

Brief description of class still missing. More...

#include <CurveMaxEntry.h>

Inheritance diagram for CurveMaxEntry:
MaxEntry

List of all members.

Public Member Functions

virtual bool operator< (const MaxEntry &o) const
virtual bool readLine (QTextStream &s)
virtual double value () const
virtual void writeHeader (QTextStream &s) const
virtual void writeLine (QTextStream &s) const
double y () const

Static Public Member Functions

static QByteArray fields ()
static bool isHeaderLine (QString f)

Detailed Description

Brief description of class still missing.

Full description of class still missing


Member Function Documentation

QByteArray CurveMaxEntry::fields ( ) [static]

References TRACE.

Referenced by readLine(), and writeHeader().

{
  TRACE;
  return "x | y";
}
bool CurveMaxEntry::isHeaderLine ( QString  f) [static]

References TRACE.

Referenced by MaxEntryList::load().

{
  TRACE;
  return f.contains("x|y");
}
bool CurveMaxEntry::operator< ( const MaxEntry o) const [virtual]

Reimplemented from MaxEntry.

References TRACE, and MaxEntry::x().

{
  TRACE;
  if(x()<o.x()) return true;
  else if(x()>o.x()) return false;
  const CurveMaxEntry& m=static_cast<const CurveMaxEntry&>(*this);
  const CurveMaxEntry& mo=static_cast<const CurveMaxEntry&>(o);
  if(m._y>mo._y) return true;
  else return false;
}
bool CurveMaxEntry::readLine ( QTextStream &  s) [virtual]

Implements MaxEntry.

References MaxEntry::_selected, MaxEntry::_time, MaxEntry::_x, fields(), QGpCoreTools::StringSection::isValid(), QGpCoreTools::StringSection::nextField(), QGpCoreTools::StringSection::toBool(), QGpCoreTools::StringSection::toDouble(), and TRACE.

{
  TRACE;
  QString line;
  do {
    line=s.readLine();
  } while(!line.isEmpty() && line[0]=='#');
  if(!line.isEmpty()) {
    const QChar * ptr=0;
    StringSection field,fields(line);
    field=fields.nextField(ptr);
    _x=field.toDouble();
    field=fields.nextField(ptr);
    _y=field.toDouble();
    field=fields.nextField(ptr);
    if(field.isValid())
      _selected=field.toBool();
    else
      _selected=true;
    _time=0.0;
    return true;
  } else {
    return false;
  }
}
virtual double CurveMaxEntry::value ( ) const [inline, virtual]

Implements MaxEntry.

{return _y;}
void CurveMaxEntry::writeHeader ( QTextStream &  s) const [virtual]

Implements MaxEntry.

References QGpCoreTools::endl(), fields(), and TRACE.

{
  TRACE;
  s << "# File generated by max2curve, generic curve processing\n";
  s << QString( "# %1 | selected").arg(fields().data()) << endl;
}
void CurveMaxEntry::writeLine ( QTextStream &  s) const [virtual]

Implements MaxEntry.

References MaxEntry::_selected, MaxEntry::_x, QGpCoreTools::endl(), and TRACE.

{
  TRACE;
  static const QString fmt("%1 %2 %3\n");
  s << fmt.arg(_x).arg(_y).arg(_selected) << endl;
}
double CurveMaxEntry::y ( ) const [inline]
{return _y;}

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