From: Samuel Just Date: Wed, 4 Dec 2013 22:34:13 +0000 (-0800) Subject: test/osd/Object: create encoders for ContDesc X-Git-Tag: v0.78~286^2~46 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=69ad880eed5ffb2e4cf24ea031df6545133111a1;p=ceph.git test/osd/Object: create encoders for ContDesc Signed-off-by: Samuel Just --- diff --git a/src/test/osd/Object.cc b/src/test/osd/Object.cc index d4be4df1bdd0..5ae2ded23cf8 100644 --- a/src/test/osd/Object.cc +++ b/src/test/osd/Object.cc @@ -7,6 +7,28 @@ #include "Object.h" +void ContDesc::encode(bufferlist &bl) const +{ + ENCODE_START(1, 1, bl); + ::encode(objnum, bl); + ::encode(cursnap, bl); + ::encode(seqnum, bl); + ::encode(prefix, bl); + ::encode(oid, bl); + ENCODE_FINISH(bl); +} + +void ContDesc::decode(bufferlist::iterator &bl) +{ + DECODE_START(1, bl); + ::decode(objnum, bl); + ::decode(cursnap, bl); + ::decode(seqnum, bl); + ::decode(prefix, bl); + ::decode(oid, bl); + DECODE_FINISH(bl); +} + ostream &operator<<(ostream &out, const ContDesc &rhs) { return out << "(ObjNum " << rhs.objnum diff --git a/src/test/osd/Object.h b/src/test/osd/Object.h index 2acaa8951f87..c5ca8cac9e00 100644 --- a/src/test/osd/Object.h +++ b/src/test/osd/Object.h @@ -1,6 +1,7 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- #include "include/interval_set.h" #include "include/buffer.h" +#include "include/encoding.h" #include #include #include @@ -42,7 +43,10 @@ public: bool operator!=(const ContDesc &rhs) { return !((*this) == rhs); } + void encode(bufferlist &bl) const; + void decode(bufferlist::iterator &bp); }; +WRITE_CLASS_ENCODER(ContDesc) ostream &operator<<(ostream &out, const ContDesc &rhs);