11 #ifndef EVIO_6_0_DATATYPE_H
12 #define EVIO_6_0_DATATYPE_H
83 static std::string names[37];
91 DataType(uint32_t val, std::string name,
int byteLen = -1) : value(val), name(std::move(name)), bytes(byteLen) {}
101 if (val > 0x24 || (val > 0x10 && val < 0x20))
return UNKNOWN32;
102 return intToType[val];
111 if (val > 0x24 || (val > 0x10 && val < 0x20))
return "UNKNOWN32";
123 for (std::string
const & name : names) {
124 if (name == typeName) {
125 return intToType[index];
140 return dataType ==
BANK.value || dataType ==
ALSOBANK.value ||
151 return (
BANK.value == dataType ||
ALSOBANK.value == dataType);
178 const std::string &
getName()
const {
return name;}
194 if (*
this ==
ALSOBANK)
return "BANK";
206 return ((*
this ==
BANK) ||
237 return ((*
this ==
UCHAR8) ||
261 #endif //EVIO_6_0_DATATYPE_H
static const DataType ALSOBANK
Bank alternate value.
Definition: DataType.h:50
static const DataType LONG64
64 bit int.
Definition: DataType.h:45
static const DataType UCHAR8
Unsigned 8 bit int.
Definition: DataType.h:43
static const DataType INT32
32 bit int.
Definition: DataType.h:47
static const DataType NVALUE
In composite data, N value.
Definition: DataType.h:58
bool isSegment() const
Convenience routine to see if "this" data type is a segment structure.
Definition: DataType.h:223
static const DataType HOLLERIT
In composite data, Hollerit type.
Definition: DataType.h:57
uint32_t getValue() const
Get the integer value associated with this data type.
Definition: DataType.h:184
static const DataType SEGMENT
Segment.
Definition: DataType.h:53
std::string toString() const
Return a string which is usually the same as the name of the enumerated value, except in the cases of...
Definition: DataType.h:193
static const DataType CHARSTAR8
ASCII characters.
Definition: DataType.h:39
bool isStructure() const
Convenience routine to see if "this" data type is a structure (a container.)
Definition: DataType.h:205
bool isBank() const
Convenience routine to see if "this" data type is a bank structure.
Definition: DataType.h:217
static const DataType DOUBLE64
64 bit double.
Definition: DataType.h:44
static const DataType COMPOSITE
Composite data type.
Definition: DataType.h:51
bool isInteger() const
Convenience method to see if "this" data type is an integer of some kind - either 8...
Definition: DataType.h:236
int getBytes() const
Return the number of bytes this data type takes (if relevant).
Definition: DataType.h:251
static const DataType & getDataType(uint32_t val)
Get the object from the integer value.
Definition: DataType.h:100
static const DataType FLOAT32
32 bit float.
Definition: DataType.h:38
static const DataType NOT_A_VALID_TYPE
Not a valid data type.
Definition: DataType.h:63
static const DataType SHORT16
16 bit int.
Definition: DataType.h:40
const std::string & getName() const
Get the name associated with this data type.
Definition: DataType.h:178
static const DataType UINT32
Unsigned 32 bit int.
Definition: DataType.h:37
static const DataType BANK
Bank.
Definition: DataType.h:52
static const DataType CHAR8
8 bit int.
Definition: DataType.h:42
static const DataType ALSOSEGMENT
Segment alternate value.
Definition: DataType.h:49
Numerical values associated with evio data types.
Definition: DataType.h:32
static const DataType mVALUE
In composite data, m value.
Definition: DataType.h:60
static bool isStructure(uint32_t dataType)
Convenience method to see if the given integer arg represents a data type which is a structure (a con...
Definition: DataType.h:139
static bool isBank(uint32_t dataType)
Convenience method to see if the given integer arg represents a BANK.
Definition: DataType.h:150
bool operator!=(const DataType &rhs) const
Definition: DataType.cpp:21
static const DataType UNKNOWN32
Unknown data type.
Definition: DataType.h:36
static bool isTagSegment(uint32_t dataType)
Convenience method to see if the given integer arg represents a TAGSEGMENT.
Definition: DataType.h:168
static const DataType USHORT16
Unsigned 16 bit int.
Definition: DataType.h:41
bool isTagSegment() const
Convenience routine to see if "this" data type is a tagsegment structure.
Definition: DataType.h:229
static const DataType TAGSEGMENT
Tag segment.
Definition: DataType.h:48
static bool isSegment(uint32_t dataType)
Convenience method to see if the given integer arg represents a SEGMENT.
Definition: DataType.h:159
static const DataType nVALUE
In composite data, n value.
Definition: DataType.h:59
static const DataType ULONG64
Unsigned 64 bit int.
Definition: DataType.h:46
static DataType valueOf(std::string const &typeName)
Get the enum constant from a string.
Definition: DataType.h:121
bool operator==(const DataType &rhs) const
Definition: DataType.cpp:17
static std::string getName(uint32_t val)
Get the name from the integer value.
Definition: DataType.h:110