25 #include <QDataStream> 53 case UndefinedType:
return "Undefined";
54 case RealType:
return "Real";
55 case StringType:
return "String";
56 case EnumType:
return "Enum";
58 return QString(
"Error in type conversion");
63 case FixedLength:
return "fixed-length";
64 case VariableLength:
return "variable-length";
66 return QString(
"Error in length type conversion");
83 Segment() : name(
""), type(UndefinedType), ltype(VariableLength), begin(-1), end(-1) {}
86 name(name), type(type), ltype(VariableLength),
91 name(name), type(type), ltype(ltype), begin(begin), end(end) {}
93 bool operator==(
const Segment& rhs)
const {
94 return (type == rhs.type) && (begin == rhs.begin) && (ltype == rhs.ltype) &&
98 bool operator<(
const Segment& rhs)
const {
99 return ((this->type < rhs.type) ||
100 ((this->type == rhs.type) && (this->ltype < rhs.ltype)) ||
101 ((this->type == rhs.type) && (this->ltype == rhs.ltype) && (this->begin < rhs.begin)) ||
102 ((this->type == rhs.type) && (this->ltype == rhs.ltype) && (this->begin == rhs.begin) && (this->end < rhs.end)));
105 inline int size()
const {
109 QString toString()
const;
116 friend QDataStream& operator<<(QDataStream& out,
const Segment& segment);
117 friend QDataStream& operator>>(QDataStream& in,
Segment& segment);
128 QList<Segment> segments;
205 void checkSingleDescriptor()
const;
219 const Segment& segment()
const;
248 QString toString()
const;
265 #endif // GAIA_REGION_H A region is a physical location in the point layout which consists in a list of segments.
Definition: region.h:125
static Segment undefined
Defines a default undefined Segment.
Definition: region.h:114
This class describes the layout of a point.
Definition: pointlayout.h:60
A segment is a physical contiguous location of descriptors of the same type in the point layout...
Definition: region.h:75
DescriptorLengthType
Either fixed-length or variable-length.
Definition: region.h:46
Main Gaia namespace, which contains all the library functions.
Definition: addfield.cpp:22
DescriptorType
The possible types of descriptors accepted.
Definition: region.h:36