13 #ifndef SCT_ByteStreamErrors_h
14 #define SCT_ByteStreamErrors_h
124 #ifndef SCT_ERRORTYPELIST
125 #define SCT_ERRORTYPELIST(XYZ) \
126 XYZ(ByteStreamParseError) \
131 XYZ(FormatterError) \
133 XYZ(TrailerOverflowError) \
134 XYZ(HeaderTrailerLimitError) \
140 XYZ(ROBFragmentError) \
141 XYZ(MissingLinkHeaderError) \
143 XYZ(ABCDError_Chip0) \
144 XYZ(ABCDError_Chip1) \
145 XYZ(ABCDError_Chip2) \
146 XYZ(ABCDError_Chip3) \
147 XYZ(ABCDError_Chip4) \
148 XYZ(ABCDError_Chip5) \
149 XYZ(ABCDError_Error1) \
150 XYZ(ABCDError_Error2) \
151 XYZ(ABCDError_Error4) \
152 XYZ(TempMaskedChip0) \
153 XYZ(TempMaskedChip1) \
154 XYZ(TempMaskedChip2) \
155 XYZ(TempMaskedChip3) \
156 XYZ(TempMaskedChip4) \
157 XYZ(TempMaskedChip5) \
158 XYZ(ABCDError_Error7) \
159 XYZ(ABCDError_Invalid) \
160 XYZ(RODSimulatedData) \
161 XYZ(NUM_ERROR_TYPES) // always have this one last, so we can use it as a loop index
162 #endif // SCT_ERRORTYPELIST
165 #define SCT_DO_ENUM(e) e,
166 #endif // SCT_DO_ENUM
168 #ifndef SCT_DO_DESCRIPTION
169 #define SCT_DO_DESCRIPTION(e) #e,
170 #endif // SCT_DO_DESCRIPTION
185 static const std::vector<std::string> ErrorTypeDescription = {
193 static const std::vector<ErrorType> BadErrors = {
197 HeaderTrailerLimitError,
201 MissingLinkHeaderError,
208 static const std::vector<ErrorType> LinkLevelBadErrors = {
212 HeaderTrailerLimitError,
219 static const std::vector<ErrorType> RodLevelBadErrors = {
222 MissingLinkHeaderError,
231 static const std::vector<ErrorType> LinkLevelErrors = {
232 ByteStreamParseError,
239 TrailerOverflowError,
240 HeaderTrailerLimitError,
265 static const std::vector<ErrorType> RodLevelErrors = {
269 MissingLinkHeaderError,
273 template<ErrorType et>
static constexpr
uint64_t maskUpTo() {
return (
uint64_t(1) <<
et ) - 1; }
275 static constexpr
uint64_t ABCDErrorMask() {
return maskUpTo<ABCDError_Chip5>() & ~(maskUpTo<ABCDError_Chip0>()); }
277 static constexpr
uint64_t TempMaskedChipsMask() {
return maskUpTo<TempMaskedChip5>() & ~(maskUpTo<TempMaskedChip0>()); }
284 TempMaskedChip5}}[chip]; }
293 #endif // SCT_ByteStreamErrors_h