All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions
GeopsyCore::MetaArrayInteger Class Reference

#include <MetaData.h>

Inheritance diagram for GeopsyCore::MetaArrayInteger:
GeopsyCore::MetaArray< int > GeopsyCore::MetaData QGpCoreTools::XMLClass QGpCoreTools::SharedObject

List of all members.

Public Member Functions

virtual int compare (int subId, const QString &index, const MetaData *o) const
virtual bool fromString (const QString &index, QString string)
 MetaArrayInteger ()
 MetaArrayInteger (const MetaArrayInteger &o)
virtual bool setData (int subId, const QString &index, const QVariant &val)
virtual QString toString (const QString &index) const

Constructor & Destructor Documentation

: MetaArray<int>() {}
: MetaArray<int>(o) {}

Member Function Documentation

int GeopsyCore::MetaArrayInteger::compare ( int  subId,
const QString &  index,
const MetaData o 
) const [virtual]

Reimplemented from GeopsyCore::MetaData.

References GeopsyCore::MetaArray< int >::value().

  {
    Q_UNUSED(valueIndex);
    int v1=value(dataIndex.toInt());
    int v2=reinterpret_cast<const MetaArrayInteger *>(o)->value(dataIndex.toInt());
    if(v1<v2) return -1;
    else if(v1>v2) return 1;
    else return 0;
  }
bool GeopsyCore::MetaArrayInteger::fromString ( const QString &  index,
QString  string 
) [virtual]

Reimplemented from GeopsyCore::MetaData.

References GeopsyCore::MetaArray< int >::count(), and GeopsyCore::MetaArray< int >::setValue().

  {
    bool ok;
    int i=index.toInt(&ok);
    if(ok && i<count(0)) {
      setValue(i, val.toInt(&ok));
      return ok;
    } else {
      return false;
    }
  }
bool GeopsyCore::MetaArrayInteger::setData ( int  subId,
const QString &  index,
const QVariant &  val 
) [virtual]

Reimplemented from GeopsyCore::MetaData.

References GeopsyCore::MetaArray< int >::count(), and GeopsyCore::MetaArray< int >::setValue().

  {
    Q_UNUSED(valueIndex);
    bool ok;
    int i=dataIndex.toInt(&ok);
    if(ok && i<count(0)) {
      setValue(i, val.toInt(&ok));
      return ok;
    } else {
      return false;
    }
  }
QString GeopsyCore::MetaArrayInteger::toString ( const QString &  index) const [virtual]

Reimplemented from GeopsyCore::MetaData.

References GeopsyCore::MetaArray< int >::count(), and GeopsyCore::MetaArray< int >::value().

  {
    bool ok;
    int i=index.toInt(&ok);
    if(ok && i<count(0)) {
      return QString::number(value(i));
    } else {
      return QString::null;
    }
  }

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