[Kst] branches/work/kst/portto4/kst/src
Peter Kümmel
syntheticpp at gmx.net
Tue Aug 10 12:33:58 CEST 2010
SVN commit 1161553 by kuemmel:
API cleanup:
- it makes no sens to read into a const object
- rename Param to ReadInfo because it is only used for reading data
M +2 -2 datasources/ascii/asciisource.cpp
M +2 -2 datasources/dirfilesource/dirfilesource.cpp
M +6 -6 datasources/netcdf/kstnetcdf.cpp
M +4 -4 datasources/qimagesource/qimagesource.cpp
M +1 -1 libkst/datamatrix.cpp
M +1 -1 libkst/datamatrix.h
M +4 -2 libkst/datascalar.cpp
M +2 -2 libkst/datascalar.h
M +1 -1 libkst/datasource.cpp
M +1 -1 libkst/datasource.h
M +4 -2 libkst/datastring.cpp
M +2 -2 libkst/datastring.h
M +1 -1 libkst/datavector.cpp
M +1 -1 libkst/datavector.h
M +1 -1 libkst/vscalar.cpp
M +2 -1 libkstapp/scalarmodel.cpp
--- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.cpp #1161552:1161553
@@ -47,7 +47,7 @@
DataInterfaceAsciiVector(AsciiSource& a) : ascii(a) {}
// read one element
- int read(const QString&, const DataVector::Param&);
+ int read(const QString&, DataVector::ReadInfo&);
// named elements
QStringList list() const { return ascii._fieldList; }
@@ -78,7 +78,7 @@
//-------------------------------------------------------------------------------------------
-int DataInterfaceAsciiVector::read(const QString& field, const DataVector::Param& p)
+int DataInterfaceAsciiVector::read(const QString& field, DataVector::ReadInfo& p)
{
return ascii.readField(p.data, field, p.startingFrame, p.numberOfFrames);
}
--- branches/work/kst/portto4/kst/src/datasources/dirfilesource/dirfilesource.cpp #1161552:1161553
@@ -57,7 +57,7 @@
DataInterfaceDirFileVector(DirFileSource& d) : dir(d) {}
// read one element
- int read(const QString&, const DataVector::Param&);
+ int read(const QString&, DataVector::ReadInfo&);
// named elements
QStringList list() const { return dir._fieldList; }
@@ -87,7 +87,7 @@
}
-int DataInterfaceDirFileVector::read(const QString& field, const DataVector::Param& p)
+int DataInterfaceDirFileVector::read(const QString& field, DataVector::ReadInfo& p)
{
return dir.readField(p.data, field, p.startingFrame, p.numberOfFrames);
}
--- branches/work/kst/portto4/kst/src/datasources/netcdf/kstnetcdf.cpp #1161552:1161553
@@ -46,7 +46,7 @@
DataInterfaceNetCdfScalar(NetcdfSource& s) : netcdf(s) {}
// read one element
- int read(const QString&, const DataScalar::Param&);
+ int read(const QString&, DataScalar::ReadInfo&);
// named elements
QStringList list() const { return netcdf._scalarList; }
@@ -67,7 +67,7 @@
};
-int DataInterfaceNetCdfScalar::read(const QString& scalar, const DataScalar::Param& p)
+int DataInterfaceNetCdfScalar::read(const QString& scalar, DataScalar::ReadInfo& p)
{
return netcdf.readScalar(p.value, scalar);
}
@@ -93,7 +93,7 @@
DataInterfaceNetCdfVector(NetcdfSource& s) : netcdf(s) {}
// read one element
- int read(const QString&, const DataVector::Param&);
+ int read(const QString&, DataVector::ReadInfo&);
// named elements
QStringList list() const { return netcdf._fieldList; }
@@ -124,7 +124,7 @@
-int DataInterfaceNetCdfVector::read(const QString& field, const DataVector::Param& p)
+int DataInterfaceNetCdfVector::read(const QString& field, DataVector::ReadInfo& p)
{
return netcdf.readField(p.data, field, p.startingFrame, p.numberOfFrames);
}
@@ -147,7 +147,7 @@
DataInterfaceNetCdfMatrix(NetcdfSource& s) : netcdf(s) {}
// read one element
- int read(const QString&, const DataMatrix::Param&);
+ int read(const QString&, DataMatrix::ReadInfo&);
// named elements
QStringList list() const { return netcdf._matrixList; }
@@ -191,7 +191,7 @@
}
-int DataInterfaceNetCdfMatrix::read(const QString& field, const DataMatrix::Param& p)
+int DataInterfaceNetCdfMatrix::read(const QString& field, DataMatrix::ReadInfo& p)
{
int count = netcdf.readMatrix(p.data->z, field);
--- branches/work/kst/portto4/kst/src/datasources/qimagesource/qimagesource.cpp #1161552:1161553
@@ -53,7 +53,7 @@
DataInterfaceQImageVector(QImage* img) : _image(img) {}
// read one element
- int read(const QString&, const DataVector::Param&);
+ int read(const QString&, DataVector::ReadInfo&);
// named elements
QStringList list() const { return _vectorList; }
@@ -106,7 +106,7 @@
-int DataInterfaceQImageVector::read(const QString& field, const DataVector::Param& p)
+int DataInterfaceQImageVector::read(const QString& field, DataVector::ReadInfo& p)
{
int i;
int s = p.startingFrame;
@@ -170,7 +170,7 @@
DataInterfaceQImageMatrix(QImage* img) : _image(img) {}
// read one element
- int read(const QString&, const DataMatrix::Param&);
+ int read(const QString&, DataMatrix::ReadInfo&);
// named elements
QStringList list() const { return _matrixList; }
@@ -224,7 +224,7 @@
}
-int DataInterfaceQImageMatrix::read(const QString& field, const DataMatrix::Param& p)
+int DataInterfaceQImageMatrix::read(const QString& field, DataMatrix::ReadInfo& p)
{
if ( _image->isNull() ) {
return 0;
--- branches/work/kst/portto4/kst/src/libkst/datamatrix.cpp #1161552:1161553
@@ -545,7 +545,7 @@
int DataMatrix::readMatrix(MatrixData* data, const QString& matrix, int xStart, int yStart, int xNumSteps, int yNumSteps, int skip)
{
- Param p = { data, xStart, yStart, xNumSteps, yNumSteps, skip};
+ ReadInfo p = { data, xStart, yStart, xNumSteps, yNumSteps, skip};
return file()->matrix().read(matrix, p);
}
--- branches/work/kst/portto4/kst/src/libkst/datamatrix.h #1161552:1161553
@@ -44,7 +44,7 @@
The suggested scaling and translation is returned in xMin, yMin, xStepSize, and yStepSize
Returns the number of *samples* read
**/
- struct KSTCORE_EXPORT Param {
+ struct KSTCORE_EXPORT ReadInfo {
MatrixData* data;
int xStart;
int yStart;
--- branches/work/kst/portto4/kst/src/libkst/datascalar.cpp #1161552:1161553
@@ -100,7 +100,8 @@
void DataScalar::internalUpdate() {
if (file()) {
file()->writeLock();
- file()->scalar().read(_field, Param(&_value));
+ ReadInfo readInfo(&_value);
+ file()->scalar().read(_field, readInfo);
file()->unlock();
}
}
@@ -165,7 +166,8 @@
}
void DataScalar::reset() {
- file()->scalar().read(_field, Param(&_value));
+ ReadInfo readInfo(&_value);
+ file()->scalar().read(_field, readInfo);
}
}
--- branches/work/kst/portto4/kst/src/libkst/datascalar.h #1161552:1161553
@@ -48,8 +48,8 @@
public:
virtual ~DataScalar();
- struct Param {
- Param(double* d) : value(d) {}
+ struct ReadInfo {
+ ReadInfo(double* d) : value(d) {}
double* value;
};
--- branches/work/kst/portto4/kst/src/libkst/datasource.cpp #1161552:1161553
@@ -55,7 +55,7 @@
struct NotSupportedImp : public DataSource::DataInterface<T>
{
// read one element
- int read(const QString&, const typename T::Param&) { return -1; }
+ int read(const QString&, typename T::ReadInfo&) { return -1; }
// named elements
QStringList list() const { return QStringList(); }
--- branches/work/kst/portto4/kst/src/libkst/datasource.h #1161552:1161553
@@ -60,7 +60,7 @@
{
// read one element
- virtual int read(const QString& name, const typename T::Param&) = 0;
+ virtual int read(const QString& name, typename T::ReadInfo&) = 0;
// named elements
virtual QStringList list() const = 0;
--- branches/work/kst/portto4/kst/src/libkst/datastring.cpp #1161552:1161553
@@ -98,7 +98,8 @@
void DataString::internalUpdate() {
if (file()) {
file()->writeLock();
- file()->string().read(_field, Param(&_value));
+ ReadInfo readInfo(&_value);
+ file()->string().read(_field, readInfo);
file()->unlock();
}
}
@@ -165,7 +166,8 @@
}
void DataString::reset() {
- file()->string().read(_field, Param(&_value));
+ ReadInfo readInfo(&_value);
+ file()->string().read(_field, readInfo);
}
}
--- branches/work/kst/portto4/kst/src/libkst/datastring.h #1161552:1161553
@@ -48,9 +48,9 @@
virtual ~DataString();
virtual void internalUpdate();
- struct KSTCORE_EXPORT Param
+ struct KSTCORE_EXPORT ReadInfo
{
- Param(QString* s) : value(s) {}
+ ReadInfo(QString* s) : value(s) {}
QString* value;
};
--- branches/work/kst/portto4/kst/src/libkst/datavector.cpp #1161552:1161553
@@ -760,7 +760,7 @@
int DataVector::readField(double *v, const QString& field, int s, int n, int skip, int *lastFrameRead)
{
- const Param par = {v, s, n, skip, lastFrameRead};
+ ReadInfo par = {v, s, n, skip, lastFrameRead};
return file()->vector().read(field, par);
}
--- branches/work/kst/portto4/kst/src/libkst/datavector.h #1161552:1161553
@@ -46,7 +46,7 @@
If it returns -9999, use the skipFrame= -1.
*/
- struct KSTCORE_EXPORT Param {
+ struct KSTCORE_EXPORT ReadInfo {
double* data;
int startingFrame;
int numberOfFrames;
--- branches/work/kst/portto4/kst/src/libkst/vscalar.cpp #1161552:1161553
@@ -123,7 +123,7 @@
f0 = _f0;
}
_file->writeLock();
- DataVector::Param p = {&_value, f0, -1, -1, 0};
+ DataVector::ReadInfo p = {&_value, f0, -1, -1, 0};
_file->vector().read(_field, p);
_file->unlock();
}
--- branches/work/kst/portto4/kst/src/libkstapp/scalarmodel.cpp #1161552:1161553
@@ -197,7 +197,8 @@
foreach(QString scalar, scalars) {
QList<QVariant> data;
double value;
- dataSource->scalar().read(scalar, DataScalar::Param(&value));
+ DataScalar::ReadInfo readInfo(&value);
+ dataSource->scalar().read(scalar, readInfo);
data << scalar << value;
new ScalarTreeItem(data, item);
}
More information about the Kst
mailing list