From f30f8668bb2c0d37db1eaa1fae95d83740e85a2b Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Thu, 28 Mar 2019 20:41:33 -0400 Subject: [PATCH] mon: Update MgrMap.h to work without using namespace Signed-off-by: Adam C. Emerson --- src/mon/MgrMap.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/mon/MgrMap.h b/src/mon/MgrMap.h index bc8dbc6f8ec..2f16a5fbaa0 100644 --- a/src/mon/MgrMap.h +++ b/src/mon/MgrMap.h @@ -41,7 +41,7 @@ public: std::set tags; std::set see_also; - void encode(bufferlist& bl) const { + void encode(ceph::buffer::list& bl) const { ENCODE_START(1, 1, bl); encode(name, bl); encode(type, bl); @@ -57,7 +57,7 @@ public: encode(see_also, bl); ENCODE_FINISH(bl); } - void decode(bufferlist::const_iterator& p) { + void decode(ceph::buffer::list::const_iterator& p) { DECODE_START(1, p); decode(name, p); decode(type, p); @@ -73,7 +73,7 @@ public: decode(see_also, p); DECODE_FINISH(p); } - void dump(Formatter *f) const { + void dump(ceph::Formatter *f) const { f->dump_string("name", name); f->dump_string("type", Option::type_to_str( static_cast(type))); @@ -113,7 +113,7 @@ public: // We do not include the module's `failed` field in the beacon, // because it is exposed via health checks. - void encode(bufferlist &bl) const { + void encode(ceph::buffer::list &bl) const { ENCODE_START(2, 1, bl); encode(name, bl); encode(can_run, bl); @@ -122,7 +122,7 @@ public: ENCODE_FINISH(bl); } - void decode(bufferlist::const_iterator &bl) { + void decode(ceph::buffer::list::const_iterator &bl) { DECODE_START(1, bl); decode(name, bl); decode(can_run, bl); @@ -138,7 +138,7 @@ public: return (name == rhs.name) && (can_run == rhs.can_run); } - void dump(Formatter *f) const { + void dump(ceph::Formatter *f) const { f->open_object_section("module"); f->dump_string("name", name); f->dump_bool("can_run", can_run); @@ -168,7 +168,7 @@ public: : gid(0) {} - void encode(bufferlist& bl) const + void encode(ceph::buffer::list& bl) const { ENCODE_START(3, 1, bl); encode(gid, bl); @@ -182,7 +182,7 @@ public: ENCODE_FINISH(bl); } - void decode(bufferlist::const_iterator& p) + void decode(ceph::buffer::list::const_iterator& p) { DECODE_START(3, p); decode(gid, p); @@ -316,7 +316,7 @@ public: return false; } - bool have_name(const string& name) const { + bool have_name(const std::string& name) const { if (active_name == name) { return true; } @@ -346,7 +346,7 @@ public: return it->second; } - void encode(bufferlist& bl, uint64_t features) const + void encode(ceph::buffer::list& bl, uint64_t features) const { if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) { ENCODE_START(5, 1, bl); @@ -358,7 +358,7 @@ public: encode(standbys, bl); encode(modules, bl); - // Pre-version 4 string list of available modules + // Pre-version 4 std::string std::list of available modules // (replaced by direct encode of ModuleInfo below) std::set old_available_modules; for (const auto &i : available_modules) { @@ -387,7 +387,7 @@ public: return; } - void decode(bufferlist::const_iterator& p) + void decode(ceph::buffer::list::const_iterator& p) { DECODE_START(7, p); decode(epoch, p); @@ -431,7 +431,7 @@ public: DECODE_FINISH(p); } - void dump(Formatter *f) const { + void dump(ceph::Formatter *f) const { f->dump_int("epoch", epoch); f->dump_int("active_gid", get_active_gid()); f->dump_string("active_name", get_active_name()); @@ -480,11 +480,11 @@ public: f->close_section(); } - static void generate_test_instances(list &l) { + static void generate_test_instances(std::list &l) { l.push_back(new MgrMap); } - void print_summary(Formatter *f, std::ostream *ss) const + void print_summary(ceph::Formatter *f, std::ostream *ss) const { // One or the other, not both ceph_assert((ss != nullptr) != (f != nullptr)); @@ -524,13 +524,13 @@ public: } } - friend ostream& operator<<(ostream& out, const MgrMap& m) { - ostringstream ss; + friend std::ostream& operator<<(std::ostream& out, const MgrMap& m) { + std::ostringstream ss; m.print_summary(nullptr, &ss); return out << ss.str(); } - friend ostream& operator<<(ostream& out, const std::vector& mi) { + friend std::ostream& operator<<(std::ostream& out, const std::vector& mi) { for (const auto &i : mi) { out << i.name << " "; } -- 2.39.5