mirror of
https://github.com/ceph/ceph
synced 2025-02-24 19:47:44 +00:00
include/uuid: convert to denc
Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
parent
574474048b
commit
72a0667330
@ -59,18 +59,23 @@ struct uuid_d {
|
||||
return (char*)uuid.data;
|
||||
}
|
||||
|
||||
void encode(ceph::buffer::list& bl) const {
|
||||
ceph::encode_raw(uuid, bl);
|
||||
void encode(::ceph::buffer::list::contiguous_appender& p) const {
|
||||
p.append(reinterpret_cast<const char *>(&uuid), sizeof(uuid));
|
||||
}
|
||||
|
||||
void decode(ceph::buffer::list::const_iterator& p) const {
|
||||
ceph::decode_raw(uuid, p);
|
||||
void bound_encode(size_t& p) const {
|
||||
p += sizeof(uuid);
|
||||
}
|
||||
|
||||
void decode(::ceph::buffer::ptr::const_iterator& p) {
|
||||
assert((p.get_end() - p.get_pos()) >= (int)sizeof(*this));
|
||||
memcpy((char *)this, p.get_pos_add(sizeof(*this)), sizeof(*this));
|
||||
}
|
||||
|
||||
void dump(ceph::Formatter *f) const;
|
||||
static void generate_test_instances(std::list<uuid_d*>& o);
|
||||
};
|
||||
WRITE_CLASS_ENCODER(uuid_d)
|
||||
WRITE_CLASS_DENC_BOUNDED(uuid_d)
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& out, const uuid_d& u) {
|
||||
char b[37];
|
||||
|
Loading…
Reference in New Issue
Block a user