00001
00002
00011 #ifndef ATHCONTAINERS_PACKEDPARAMETERS_H
00012 #define ATHCONTAINERS_PACKEDPARAMETERS_H
00013
00014
00015 #include "AthContainersInterfaces/AuxDataOption.h"
00016 #include <limits>
00017 #include <stdint.h>
00018
00019
00020 namespace SG {
00021
00022
00060 class PackedParameters
00061 {
00062 public:
00068 PackedParameters();
00069
00070
00081 PackedParameters (uint8_t nbits, uint8_t flags);
00082
00083
00091 template <class T>
00092 PackedParameters(T);
00093
00094
00098 uint8_t nbits() const;
00099
00100
00109 uint8_t nmantissa() const;
00110
00111
00117 uint8_t flags() const;
00118
00119
00126 float scale() const;
00127
00128
00132 bool isSigned() const;
00133
00134
00138 bool isFloat() const;
00139
00140
00144 bool hasScale() const;
00145
00146
00150 bool rounding() const;
00151
00152
00165 bool setNbits (uint8_t nbits);
00166
00167
00181 bool setNmantissa (uint8_t nmantissa);
00182
00183
00195 bool setScale (float scale);
00196
00197
00209 bool setSigned (bool flag);
00210
00211
00220 bool setRounding (bool flag);
00221
00222
00232 bool setFloat (bool flag);
00233
00234
00242 static bool isValidOption (const AuxDataOption& option);
00243
00244
00255 bool setOption (const AuxDataOption& option);
00256
00257
00261 enum {
00262 FLAG_IS_SIGNED = (1<<0),
00263 FLAG_IS_FLOAT = (1<<1),
00264 FLAG_HAS_SCALE = (1<<2),
00265 FLAG_ROUNDING = (1<<3),
00266 };
00267
00268
00269 private:
00271 uint8_t m_nbits;
00272
00275 uint8_t m_nmantissa;
00276
00278 float m_scale;
00279
00281 uint8_t m_flags;
00282 };
00283
00284
00285 }
00286
00287
00288 #include "AthContainers/PackedParameters.icc"
00289
00290
00291 #endif // not ATHCONTAINERS_PACKEDPARAMETERS_H
00292