Clean-up: modernize pretty_xml.cpp
[lttng-tools.git] / src / bin / lttng-sessiond / ust-registry-event.hpp
index 08b18a5c7504da8cfa5c3efd10ac021f64a1d35f..38d96eb8fbd179b9a6982bac0377b1ce68cb7d4c 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <common/format.hpp>
 #include <common/hashtable/hashtable.hpp>
+
 #include <vendor/optional.hpp>
 
 #include <typeinfo>
@@ -28,15 +29,19 @@ namespace ust {
 class registry_event : public lttng::sessiond::trace::event_class {
 public:
        registry_event(unsigned int id,
-                       unsigned int stream_class_id,
-                       int session_objd,
-                       int channel_objd,
-                       std::string name,
-                       std::string signature,
-                       std::vector<lttng::sessiond::trace::field::cuptr> fields,
-                       int loglevel_value,
-                       nonstd::optional<std::string> model_emf_uri);
-       virtual ~registry_event() = default;
+                      unsigned int stream_class_id,
+                      int session_objd,
+                      int channel_objd,
+                      std::string name,
+                      std::string signature,
+                      std::vector<lttng::sessiond::trace::field::cuptr> fields,
+                      int loglevel_value,
+                      nonstd::optional<std::string> model_emf_uri);
+       ~registry_event() override = default;
+       registry_event(const registry_event&) = delete;
+       registry_event(registry_event&&) = delete;
+       registry_event& operator=(registry_event&&) = delete;
+       registry_event& operator=(const registry_event&) = delete;
 
        /* Both objd are set by the tracer. */
        const int session_objd;
@@ -53,7 +58,8 @@ public:
         * Node in the ust-registry hash table. The event name is used to
         * initialize the node and the event_name/signature for the match function.
         */
-       struct lttng_ht_node_u64 _node;
+       struct cds_lfht_node _node;
+       struct rcu_head _head;
 };
 
 void registry_event_destroy(registry_event *event);
@@ -62,17 +68,27 @@ void registry_event_destroy(registry_event *event);
 } /* namespace sessiond */
 } /* namespace lttng */
 
+/*
+ * Due to a bug in g++ < 7.1, this specialization must be enclosed in the fmt namespace,
+ * see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480.
+ */
+namespace fmt {
 template <>
-struct fmt::formatter<lttng::sessiond::ust::registry_event> : fmt::formatter<std::string> {
-       template <typename FormatCtx>
-       typename FormatCtx::iterator format(
-                       const lttng::sessiond::ust::registry_event& event, FormatCtx& ctx)
+struct formatter<lttng::sessiond::ust::registry_event> : formatter<std::string> {
+       template <typename FormatContextType>
+       typename FormatContextType::iterator
+       format(const lttng::sessiond::ust::registry_event& event, FormatContextType& ctx)
        {
-               return fmt::format_to(ctx.out(),
-                               "{{ name = `{}`, signature = `{}`, id = {}, session objd = {}, channel objd = {} }}",
-                               event.name, event.signature, event.id, event.session_objd,
-                               event.channel_objd);
+               return format_to(
+                       ctx.out(),
+                       "{{ name = `{}`, signature = `{}`, id = {}, session objd = {}, channel objd = {} }}",
+                       event.name,
+                       event.signature,
+                       event.id,
+                       event.session_objd,
+                       event.channel_objd);
        }
 };
+} /* namespace fmt */
 
 #endif /* LTTNG_UST_REGISTRY_EVENT_H */
This page took 0.024106 seconds and 4 git commands to generate.