From 4c613b55f73603113ee57763238000af3e14f966 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 4 Oct 2024 15:45:48 +0200 Subject: [PATCH] common/entity_name: un-inline methods to reduce header dependencies Signed-off-by: Max Kellermann --- src/common/entity_name.cc | 14 ++++++++++++++ src/common/entity_name.h | 15 ++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/common/entity_name.cc b/src/common/entity_name.cc index 6e1ad62526e..502f28f9d62 100644 --- a/src/common/entity_name.cc +++ b/src/common/entity_name.cc @@ -21,6 +21,20 @@ using std::string; +void EntityName::encode(ceph::buffer::list& bl) const { + using ceph::encode; + encode(type, bl); + encode(id, bl); +} + +void EntityName::decode(ceph::buffer::list::const_iterator& bl) { + using ceph::decode; + uint32_t type_; + std::string id_; + decode(type_, bl); + decode(id_, bl); + set(type_, id_); +} const std::array EntityName::STR_TO_ENTITY_TYPE = {{ { CEPH_ENTITY_TYPE_AUTH, "auth" }, diff --git a/src/common/entity_name.h b/src/common/entity_name.h index 6967415d1b3..04aa666ad35 100644 --- a/src/common/entity_name.h +++ b/src/common/entity_name.h @@ -34,19 +34,8 @@ namespace ceph { class Formatter; } */ struct EntityName { - void encode(ceph::buffer::list& bl) const { - using ceph::encode; - encode(type, bl); - encode(id, bl); - } - void decode(ceph::buffer::list::const_iterator& bl) { - using ceph::decode; - uint32_t type_; - std::string id_; - decode(type_, bl); - decode(id_, bl); - set(type_, id_); - } + void encode(ceph::buffer::list& bl) const; + void decode(ceph::buffer::list::const_iterator& bl); void dump(ceph::Formatter *f) const; static void generate_test_instances(std::list& ls); const std::string& to_str() const; -- 2.39.5