[inspect][codelab][cpp] Add node that was introduced in part_2 to all the parts
TESTED=existing tests
Change-Id: Idc22e8a42c116b7144f21ee84c50b51e27f2ecfb
diff --git a/src/diagnostics/examples/inspect/cpp/part_3/reverser.cc b/src/diagnostics/examples/inspect/cpp/part_3/reverser.cc
index 4f168dd..4081155 100644
--- a/src/diagnostics/examples/inspect/cpp/part_3/reverser.cc
+++ b/src/diagnostics/examples/inspect/cpp/part_3/reverser.cc
@@ -37,10 +37,13 @@
// particular implementation of a FIDL interface. This particular binding set is configured to
// bind incoming requests to unique_ptr<Reverser>, which means the binding set itself takes
// ownership of the created Reversers and frees them when the connection is closed.
- return [node = std::move(node), global_request_count,
+ return [connection_count = node.CreateUint("connection_count", 0), node = std::move(node),
+ global_request_count,
binding_set =
std::make_unique<fidl::BindingSet<ReverserProto, std::unique_ptr<Reverser>>>()](
fidl::InterfaceRequest<ReverserProto> request) mutable {
+ connection_count.Add(1);
+
// Create a stats structure for the new reverser.
ReverserStats stats{.connection_node = node.CreateChild(node.UniqueName("connection-")),
.global_request_count = global_request_count};
diff --git a/src/diagnostics/examples/inspect/cpp/part_4/reverser.cc b/src/diagnostics/examples/inspect/cpp/part_4/reverser.cc
index 4f168dd..4081155 100644
--- a/src/diagnostics/examples/inspect/cpp/part_4/reverser.cc
+++ b/src/diagnostics/examples/inspect/cpp/part_4/reverser.cc
@@ -37,10 +37,13 @@
// particular implementation of a FIDL interface. This particular binding set is configured to
// bind incoming requests to unique_ptr<Reverser>, which means the binding set itself takes
// ownership of the created Reversers and frees them when the connection is closed.
- return [node = std::move(node), global_request_count,
+ return [connection_count = node.CreateUint("connection_count", 0), node = std::move(node),
+ global_request_count,
binding_set =
std::make_unique<fidl::BindingSet<ReverserProto, std::unique_ptr<Reverser>>>()](
fidl::InterfaceRequest<ReverserProto> request) mutable {
+ connection_count.Add(1);
+
// Create a stats structure for the new reverser.
ReverserStats stats{.connection_node = node.CreateChild(node.UniqueName("connection-")),
.global_request_count = global_request_count};
diff --git a/src/diagnostics/examples/inspect/cpp/part_5/reverser.cc b/src/diagnostics/examples/inspect/cpp/part_5/reverser.cc
index 4f168dd..4081155 100644
--- a/src/diagnostics/examples/inspect/cpp/part_5/reverser.cc
+++ b/src/diagnostics/examples/inspect/cpp/part_5/reverser.cc
@@ -37,10 +37,13 @@
// particular implementation of a FIDL interface. This particular binding set is configured to
// bind incoming requests to unique_ptr<Reverser>, which means the binding set itself takes
// ownership of the created Reversers and frees them when the connection is closed.
- return [node = std::move(node), global_request_count,
+ return [connection_count = node.CreateUint("connection_count", 0), node = std::move(node),
+ global_request_count,
binding_set =
std::make_unique<fidl::BindingSet<ReverserProto, std::unique_ptr<Reverser>>>()](
fidl::InterfaceRequest<ReverserProto> request) mutable {
+ connection_count.Add(1);
+
// Create a stats structure for the new reverser.
ReverserStats stats{.connection_node = node.CreateChild(node.UniqueName("connection-")),
.global_request_count = global_request_count};