36 for (
auto & move : other.
moves)
37 moves.push_back( make_shared<RangeMoveSpec>(*move) );
40 uint8_t BalancePlan::encoding_version()
const {
44 size_t BalancePlan::encoded_length_internal()
const {
47 for (
auto &move : moves)
48 length += move->encoded_length();
79 void BalancePlan::encode_internal(uint8_t **bufp)
const {
83 for (
auto &move : moves)
87 void BalancePlan::decode_internal(uint8_t version,
const uint8_t **bufp,
94 for (
size_t i=0; i<count; i++) {
95 move_spec = make_shared<RangeMoveSpec>();
96 move_spec->decode(bufp, remainp);
97 moves.push_back(move_spec);
104 os <<
"{BalancePlan:";
105 for (
size_t i=0; i<plan.
moves.size(); i++)
106 os <<
" " << (*plan.
moves[i]);
char * decode_vstr(const uint8_t **bufp, size_t *remainp)
Decode a vstr (vint64, data, null).
size_t encoded_length_vstr(size_t len)
Computes the encoded length of vstr (vint64, data, null)
uint32_t decode_i32(const uint8_t **bufp, size_t *remainp)
Decode a 32-bit integer in little-endian order.
void encode_i32(uint8_t **bufp, uint32_t val)
Encode a 32-bit integer in little-endian order.
Compatibility Macros for C/C++.
std::ostream & operator<<(std::ostream &os, const crontab_entry &entry)
Helper function to write crontab_entry to an ostream.
Functions to serialize/deserialize primitives to/from a memory buffer.
void encode_vstr(uint8_t **bufp, const void *buf, size_t len)
Encode a buffer as variable length string (vint64, data, null)
std::vector< RangeMoveSpecPtr > moves
std::shared_ptr< RangeMoveSpec > RangeMoveSpecPtr