From: Jérémie Galarneau Date: Thu, 12 Jan 2023 21:40:32 +0000 (-0500) Subject: sessiond: rename transfer_* method to move_* X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c22ded1240ab0726421d43f0ccbcbc9a03ca2e59;p=lttng-tools.git sessiond: rename transfer_* method to move_* Other similar methods use the 'move' terminology to express a transfer of ownership. Signed-off-by: Jérémie Galarneau Change-Id: Ide2bc0f49ab8b40dd6af01b45c79e058f9c6b14a --- diff --git a/src/bin/lttng-sessiond/ctf2-trace-class-visitor.cpp b/src/bin/lttng-sessiond/ctf2-trace-class-visitor.cpp index 169d370bd..f2f32c168 100644 --- a/src/bin/lttng-sessiond/ctf2-trace-class-visitor.cpp +++ b/src/bin/lttng-sessiond/ctf2-trace-class-visitor.cpp @@ -116,7 +116,7 @@ public: } /* Only call once. */ - json::json transfer_fragment() + json::json move_fragment() { return std::move(_environment); } @@ -139,7 +139,7 @@ public: } /* Only call once. */ - json::json transfer_fragment() + json::json move_fragment() { return std::move(_fragment); } @@ -151,7 +151,7 @@ private: field.get_type().accept(field_type_visitor); _fragment["name"] = field.name; - _fragment["field-class"] = field_type_visitor.transfer_fragment(); + _fragment["field-class"] = field_type_visitor.move_fragment(); } virtual void visit(const lst::integer_type& type) override final @@ -247,7 +247,7 @@ private: ::ctf2::field_visitor element_visitor; type.element_type->accept(element_visitor); - _fragment["element-field-class"] = element_visitor.transfer_fragment(); + _fragment["element-field-class"] = element_visitor.move_fragment(); if (type.alignment != 0) { _fragment["minimum-alignment"] = type.alignment; @@ -262,7 +262,7 @@ private: ::ctf2::field_visitor element_visitor; type.element_type->accept(element_visitor); - _fragment["element-field-class"] = element_visitor.transfer_fragment(); + _fragment["element-field-class"] = element_visitor.move_fragment(); if (type.alignment != 0) { _fragment["minimum-alignment"] = type.alignment; @@ -313,7 +313,7 @@ private: json::json member_class; field->accept(member_visitor); - member_classes_value.emplace_back(member_visitor.transfer_fragment()); + member_classes_value.emplace_back(member_visitor.move_fragment()); } _fragment["member-classes"] = std::move(member_classes_value); @@ -333,7 +333,7 @@ private: /* TODO missing selector-field-range. */ member_class["selector-field-ranges"] = {{option.first.range.begin, option.first.range.end}}; option.second->accept(option_visitor); - member_class["field-class"] = option_visitor.transfer_fragment(); + member_class["field-class"] = option_visitor.move_fragment(); options_value.emplace_back(std::move(member_class)); } @@ -388,14 +388,14 @@ void lsc::trace_class_visitor::visit(const lst::trace_class& trace_class) ::ctf2::trace_environment_visitor environment_visitor; trace_class.accept(environment_visitor); - trace_class_fragment["environment"] = environment_visitor.transfer_fragment(); + trace_class_fragment["environment"] = environment_visitor.move_fragment(); const auto packet_header = trace_class.get_packet_header(); if (packet_header) { ::ctf2::field_visitor field_visitor; packet_header->accept(field_visitor); - trace_class_fragment["packet-header-field-class"] = field_visitor.transfer_fragment(); + trace_class_fragment["packet-header-field-class"] = field_visitor.move_fragment(); } append_metadata_fragment(trace_class_fragment); @@ -437,7 +437,7 @@ void lsc::trace_class_visitor::visit(const lst::stream_class& stream_class) ::ctf2::field_visitor visitor; packet_context->accept(visitor); - stream_class_fragment["packet-context-field-class"] = visitor.transfer_fragment(); + stream_class_fragment["packet-context-field-class"] = visitor.move_fragment(); } const auto event_header = stream_class.get_event_header(); @@ -446,7 +446,7 @@ void lsc::trace_class_visitor::visit(const lst::stream_class& stream_class) event_header->accept(visitor); stream_class_fragment["event-record-header-field-class"] = - visitor.transfer_fragment(); + visitor.move_fragment(); } const auto event_context = stream_class.get_event_context(); @@ -455,7 +455,7 @@ void lsc::trace_class_visitor::visit(const lst::stream_class& stream_class) event_context->accept(visitor); stream_class_fragment["event-record-common-context-field-class"] = - visitor.transfer_fragment(); + visitor.move_fragment(); } append_metadata_fragment(stream_class_fragment); @@ -473,7 +473,7 @@ void lsc::trace_class_visitor::visit(const lst::event_class& event_class) ::ctf2::field_visitor visitor; event_class.payload->accept(visitor); - event_class_fragment["payload-field-class"] = visitor.transfer_fragment(); + event_class_fragment["payload-field-class"] = visitor.move_fragment(); } append_metadata_fragment(event_class_fragment); diff --git a/src/bin/lttng-sessiond/tsdl-trace-class-visitor.cpp b/src/bin/lttng-sessiond/tsdl-trace-class-visitor.cpp index ac1be1bf2..60e1f2f6a 100644 --- a/src/bin/lttng-sessiond/tsdl-trace-class-visitor.cpp +++ b/src/bin/lttng-sessiond/tsdl-trace-class-visitor.cpp @@ -397,7 +397,7 @@ public: } /* Only call once. */ - std::string transfer_description() + std::string move_description() { return std::move(_description); } @@ -797,7 +797,7 @@ public: } /* Only call once. */ - std::string transfer_description() + std::string move_description() { _environment += "};\n\n"; return std::move(_environment); @@ -852,14 +852,14 @@ void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::trace_class& fmt::arg("uuid", lttng::utils::uuid_to_str(trace_class.uuid)), fmt::arg("byte_order", trace_class.abi.byte_order == lst::byte_order::BIG_ENDIAN_ ? "be" : "le"), - fmt::arg("packet_header_layout", packet_header_visitor.transfer_description())); + fmt::arg("packet_header_layout", packet_header_visitor.move_description())); /* Declare trace scope and type aliases. */ append_metadata_fragment(trace_class_tsdl); tsdl_trace_environment_visitor environment_visitor; trace_class.accept(environment_visitor); - append_metadata_fragment(environment_visitor.transfer_description()); + append_metadata_fragment(environment_visitor.move_description()); } void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::clock_class& clock_class) @@ -911,7 +911,7 @@ void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::stream_class event_header->accept(variant_sanitizer); event_header->accept(event_header_visitor); stream_class_str += fmt::format(" event.header := {};\n", - event_header_visitor.transfer_description()); + event_header_visitor.move_description()); } const auto *packet_context = stream_class.get_packet_context(); @@ -922,7 +922,7 @@ void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::stream_class packet_context->accept(variant_sanitizer); packet_context->accept(packet_context_visitor); stream_class_str += fmt::format(" packet.context := {};\n", - packet_context_visitor.transfer_description()); + packet_context_visitor.move_description()); } const auto *event_context = stream_class.get_event_context(); @@ -932,7 +932,7 @@ void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::stream_class event_context->accept(variant_sanitizer); event_context->accept(event_context_visitor); stream_class_str += fmt::format(" event.context := {};\n", - event_context_visitor.transfer_description()); + event_context_visitor.move_description()); } stream_class_str += "};\n\n"; @@ -972,7 +972,7 @@ void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::event_class& event_class.payload->accept(payload_visitor); event_class_str += fmt::format( - " fields := {};\n}};\n\n", payload_visitor.transfer_description()); + " fields := {};\n}};\n\n", payload_visitor.move_description()); append_metadata_fragment(event_class_str); }