BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
QREDataLoader.cpp File Reference

Description

Implements class QREDataLoader.

Homepage:\n http://www.bornagainproject.org
License:\n GNU General Public License v3 or higher (see COPYING)
Authors
Scientific Computing Group at MLZ (see CITATION, AUTHORS)

Definition in file QREDataLoader.cpp.

Include dependency graph for QREDataLoader.cpp:

Go to the source code of this file.

Functions

QDataStream & operator<< (QDataStream &stream, const QREDataLoader::ErrorDefinition &s)
 
QDataStream & operator<< (QDataStream &stream, const QREDataLoader::ImportSettings &s)
 
QDataStream & operator>> (QDataStream &stream, QREDataLoader::ErrorDefinition &s)
 
QDataStream & operator>> (QDataStream &stream, QREDataLoader::ImportSettings &s)
 

Function Documentation

◆ operator<<() [1/2]

QDataStream& operator<< ( QDataStream &  stream,
const QREDataLoader::ErrorDefinition s 
)

Definition at line 760 of file QREDataLoader.cpp.

761 {
762  stream << (quint8)s.type;
763  if (std::holds_alternative<int>(s.data)) {
764  stream << true;
765  stream << quint32(std::get<int>(s.data));
766  } else {
767  stream << false;
768  stream << qreal(std::get<double>(s.data));
769  }
770 
771  return stream;
772 }
std::variant< int, double > data
Additional data; meaning depends on the error type (see implementation of toString() for more informa...

◆ operator<<() [2/2]

QDataStream& operator<< ( QDataStream &  stream,
const QREDataLoader::ImportSettings s 
)

Definition at line 572 of file QREDataLoader.cpp.

573 {
574  stream << s.serialize();
575  return stream;
576 }

◆ operator>>() [1/2]

QDataStream& operator>> ( QDataStream &  stream,
QREDataLoader::ErrorDefinition s 
)

Definition at line 774 of file QREDataLoader.cpp.

775 {
776  quint8 t;
777  stream >> t;
779  bool isInt = false;
780  stream >> isInt;
781  if (isInt) {
782  quint32 d;
783  stream >> d;
784  s.data = int(d);
785  } else {
786  qreal d;
787  stream >> d;
788  s.data = double(d);
789  }
790 
791  return stream;
792 }

◆ operator>>() [2/2]

QDataStream& operator>> ( QDataStream &  stream,
QREDataLoader::ImportSettings s 
)

Definition at line 578 of file QREDataLoader.cpp.

579 {
580  QByteArray b;
581  stream >> b;
582  s.deserialize(b);
583  return stream;
584 }
void deserialize(const QByteArray &data)