MCPcopy Create free account
hub / github.com/cwida/ALP / Pack

Method Pack

publication/source_code/include/chimp/packed_data.hpp:47–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 }
46
47 static inline uint16_t Pack(uint8_t index, uint8_t leading_zero, uint8_t significant_bits) {
48 static constexpr uint8_t BIT_SIZE = (sizeof(CHIMP_TYPE) * 8);
49
50 uint16_t result = 0;
51 result += ((uint32_t)BIT_SIZE << 3) * (ChimpConstants::BUFFER_SIZE + index);
52 result += BIT_SIZE * (leading_zero & 7);
53 if (BIT_SIZE == 32) {
54 // Shift the result by 1 to occupy the 16th bit
55 result <<= 1;
56 }
57 result += (significant_bits & 63);
58
59 return result;
60 }
61};
62
63template <bool EMPTY>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected