23 #include <QStringList> 24 #include <QTextStream> 27 #include "pointlayout.h" 28 #include "descriptor.h" 44 UnscopedData() : freal(0, Real()), flabel(0, QString()), fenumeration(0, Enum()) {}
47 return (this->vreal == rhs.vreal)
48 && (this->vlabel == rhs.vlabel)
49 && (this->venumeration == rhs.venumeration)
50 && (this->freal == rhs.freal)
51 && (this->flabel == rhs.flabel)
52 && (this->fenumeration == rhs.fenumeration);
60 Scope() : name(
""), start(0.0), end(0.0) {}
62 bool operator==(
const Scope& rhs)
const {
63 return (this->name == rhs.name)
64 && (this->start == rhs.start)
65 && (this->end == rhs.end);
68 friend QDataStream& operator<<(QDataStream& out,
const Scope& scope);
69 friend QDataStream& operator>>(QDataStream& in,
Scope& scope);
78 return (this->scope == rhs.scope) && (this->data == rhs.data);
82 return !operator==(rhs);
86 QDataStream& operator<<(QDataStream& out,
const ScopedData& s);
87 QDataStream& operator>>(QDataStream& in,
ScopedData& s);
115 QString
name()
const {
return _name; }
120 void setName(
const QString& name) { _name = name; }
126 void load(
const QString& filename,
127 const QStringList& select = QStringList() <<
"*",
128 const QStringList& exclude = QStringList());
134 void loadFromString(
const std::string& str,
135 const QStringList& select = QStringList() <<
"*",
136 const QStringList& exclude = QStringList());
142 void fromBase64(
const std::string& data);
147 void fromBase64(
const QByteArray& data);
152 std::string toBase64()
const;
155 Point() : _data(1) {}
156 Point(
const Point& rhs) : _name(rhs._name), _data(rhs._data), _layout(rhs._layout) {}
164 _layout = rhs._layout;
170 bool operator==(
const Point& rhs)
const;
177 static Point* fromSingleSegment(
const Point* point,
int nsegment);
190 void setSegment(
int nsegment,
const Point* point,
int origsegment = 0);
208 void setLayout(
const PointLayout& layout,
int nsegments = 0);
221 int numberSegments()
const {
return _data.size(); }
230 void setValue(
int nsegment,
const QString& name,
const RealDescriptor& value);
233 void setLabel(
int nsegment,
const QString& name,
const StringDescriptor& label);
244 const RealDescriptor& frealData(
int i=0)
const {
return _data[i].data.freal; }
245 RealDescriptor& frealData(
int i=0) {
return _data[i].data.freal; }
247 const StringDescriptor& fstringData(
int i=0)
const {
return _data[i].data.flabel; }
250 const EnumDescriptor& fenumData(
int i=0)
const {
return _data[i].data.fenumeration; }
251 EnumDescriptor& fenumData(
int i=0) {
return _data[i].data.fenumeration; }
253 const Scope& scope(
int i=0)
const { checkValidSegment(
this, i);
return _data[i].scope; }
254 Scope& scope(
int i=0) { checkValidSegment(
this, i);
return _data[i].scope; }
280 void remapLayoutAndEnums(
const PointLayout& layout);
285 static void checkValidSegment(
const Point* point,
int segment);
294 void applyLayout(
int nsegments);
297 const QString& parentName =
"");
303 const QStringList& select,
304 const QStringList& exclude);
308 friend QDataStream& operator<<(QDataStream& out,
const Point& point);
309 friend QDataStream& operator>>(QDataStream& in,
Point& point);
314 #define FORSEG(p) for (int nseg=0; nseg<(p).numberSegments(); nseg++) 318 #endif // GAIA_POINT_H void setLayoutUnsafe(const PointLayout &layout)
WARNING: Use this function only if you know 100% what you're doing! This neither make sure the layout...
Definition: point.h:272
This class represents a dataset and all related information.
Definition: dataset.h:91
This class describes the layout of a point.
Definition: pointlayout.h:60
Main Gaia namespace, which contains all the library functions.
Definition: addfield.cpp:22
QString name() const
Returns the point name, which also acts as its unique identifier.
Definition: point.h:115
const PointLayout & layout() const
Returns the current layout of the point.
Definition: point.h:195
PointLayout & layout()
Returns the current layout of the point.
Definition: point.h:200
void setName(const QString &name)
Sets the point name, which also acts as its unique identifier.
Definition: point.h:120