otsdaq  v2_05_02_indev
BitManipulator.h
1 #ifndef ots_BitManipulator_h
2 #define ots_BitManipulator_h
3 
4 #include <stdint.h>
5 #include <string>
6 
7 namespace ots
8 {
10 {
11  public:
12  BitManipulator(void);
13  ~BitManipulator(void);
14  static uint64_t insertBits(uint64_t& data, uint64_t value, unsigned int startBit, unsigned int numberOfBits);
15  static uint64_t insertBits(std::string& data, uint64_t value, unsigned int startBit, unsigned int numberOfBits);
16  static uint64_t reverseBits(uint64_t data, unsigned int startBit, unsigned int numberOfBits);
17  static uint32_t insertBits(uint32_t& data, uint32_t value, unsigned int startBit, unsigned int numberOfBits);
18  static uint32_t insertBits(std::string& data, uint32_t value, unsigned int startBit, unsigned int numberOfBits);
19  static uint32_t reverseBits(uint32_t data, unsigned int startBit, unsigned int numberOfBits);
20  static uint32_t readBits(uint32_t data, unsigned int startBit, unsigned int numberOfBits);
21 };
22 
23 } // namespace ots
24 
25 #endif