Lines Matching +full:data +full:- +full:bits

8  *     http://www.apache.org/licenses/LICENSE-2.0
19 #include <ipmid/api-types.hpp>
22 #include <phosphor-logging/lg2.hpp>
91 // size to hold 64 bits plus one (possibly-)partial byte
97 * @brief a payload class that provides a mechanism to pack and unpack data
101 * variable-length functions, it is possible to have function signature have a
102 * Payload object, which will then allow the remaining data to be extracted as
120 explicit Payload(SecureBuffer&& data) : raw(std::move(data)) {} in Payload()
146 * @param sz - new size for the buffer
155 uint8_t* data() in data() function
157 return raw.data(); in data()
162 const uint8_t* data() const in data() function
164 return raw.data(); in data()
173 * @tparam T - the type pointer to return; must be compatible to a byte
175 * @param begin - a pointer to the beginning of the series
176 * @param end - a pointer to the end of the series
186 // this interface only allows full-byte access; pack in partial bytes in append()
193 * @brief append a series of bits to the buffer
195 * Only the lowest @count order of bits will be appended, with the most
196 * significant of those bits getting appended first.
198 * @param count - number of bits to append
199 * @param bits - a byte with count significant bits to append
201 void appendBits(size_t count, uint8_t bits) in appendBits()
206 // add in the new bits as the higher-order bits, filling LSBit first in appendBits()
207 fixed_uint_t<details::bitStreamSize> tmp = bits; in appendBits()
217 * @brief empty out the bucket and pack it as bytes LSB-first
219 * @param wholeBytesOnly - if true, only the whole bytes will be drained
237 bitCount -= bitsOut; in drain()
250 * @tparam Arg - the type of the first argument
251 * @tparam Args - the type of the optional remaining arguments
253 * @param arg - the first argument to pack
254 * @param args... - the optional remaining arguments to pack
256 * @return int - non-zero on pack errors
278 * @param p - The payload to prepend
280 * @retunr int - non-zero on prepend errors
299 * @tparam T - the type pointer to return; must be compatible to a byte
301 * @param count - the number of bytes to return
303 * @return - a tuple of pointers (begin,begin+count)
313 // this interface only allows full-byte access; skip partial bits in pop()
316 // WARN on unused bits? in pop()
319 if (count <= (raw.size() - rawIndex)) in pop()
322 reinterpret_cast<T*>(raw.data() + rawIndex), in pop()
323 reinterpret_cast<T*>(raw.data() + rawIndex + count)); in pop()
333 * @brief fill bit stream with at least count bits for consumption
335 * @param count - number of bit needed
337 * @return - unpackError
341 // add more bits to the top end of the bitstream in fillBits()
342 // so we consume bits least-significant first in fillBits()
343 if (count > (details::bitStreamSize - CHAR_BIT)) in fillBits()
368 * @brief consume count bits from bitstream (must call fillBits first)
370 * @param count - number of bit needed
372 * @return - count bits from stream
381 // consume bits low-order bits first in popBits()
382 auto bits = bitStream.convert_to<uint8_t>(); in popBits() local
383 bits &= ((1 << count) - 1); in popBits()
385 bitCount -= count; in popBits()
386 return bits; in popBits()
390 * @brief discard all partial bits
411 * @return bool - true if the stream has been unpacked and has no errors
428 * @tparam Arg - the type of the first argument
429 * @tparam Args - the type of the optional remaining arguments
431 * @param arg - the first argument to unpack
432 * @param args... - the optional remaining arguments to unpack
434 * @return int - non-zero for unpack error
455 * @tparam Types - the implicitly declared list of the tuple element types
457 * @param t - the tuple of values to unpack
459 * @return int - non-zero on unpack error
481 // partial bytes in the form of bits
492 * @brief high-level interface to an IPMI response
501 * - Default constructor to avoid nullptrs.
503 * - Copy operations.
504 * - Move operations.
505 * - Destructor.
523 * @tparam Args - the type of the optional arguments
525 * @param args... - the optional arguments to pack
527 * @return int - non-zero on pack errors
541 * @tparam Types - the implicitly declared list of the tuple element types
543 * @param t - the tuple of values to pack
545 * @return int - non-zero on pack errors
559 * @param p - The payload to prepend
561 * @retunr int - non-zero on prepend errors
574 * @brief high-level interface to an IPMI request
582 * - Default constructor to avoid nullptrs.
584 * - Copy operations.
585 * - Move operations.
586 * - Destructor.
604 * @tparam Args - the type of the optional arguments
606 * @param args... - the optional arguments to unpack
608 * @return int - non-zero for unpack error
616 // not all bits were consumed by requested parameters in unpack()
623 // not all bits were consumed by requested parameters in unpack()
636 * @tparam Types - the implicitly declared list of the tuple element types
638 * @param t - the tuple of values to unpack
640 * @return int - non-zero on unpack error