1212#include " examplemanager-planet1-client-glue.h"
1313#include < sdbus-c++/sdbus-c++.h>
1414#include < iostream>
15- #include < thread>
15+ #include < utility>
16+ #include < map>
17+ #include < string>
18+ #include < vector>
19+ #include < memory>
1620
1721class PlanetProxy final : public sdbus::ProxyInterfaces< org::sdbuscpp::ExampleManager::Planet1_proxy >
1822{
1923public:
2024 PlanetProxy (sdbus::IConnection& connection, sdbus::ServiceName destination, sdbus::ObjectPath path)
21- : ProxyInterfaces(connection, std::move(destination), std::move(path))
25+ : ProxyInterfaces(connection, std::move(destination), std::move(path))
2226 {
2327 registerProxy ();
2428 }
2529
30+ PlanetProxy (const PlanetProxy&) = delete ;
31+ PlanetProxy& operator =(const PlanetProxy&) = delete ;
32+ PlanetProxy (PlanetProxy&&) = delete ;
33+ PlanetProxy& operator =(PlanetProxy&&) = delete ;
34+
2635 ~PlanetProxy ()
2736 {
2837 unregisterProxy ();
@@ -35,11 +44,16 @@ class ManagerProxy final : public sdbus::ProxyInterfaces<sdbus::ObjectManager_pr
3544 ManagerProxy (sdbus::IConnection& connection, sdbus::ServiceName destination, sdbus::ObjectPath path)
3645 : ProxyInterfaces(connection, destination, std::move(path))
3746 , m_connection(connection)
38- , m_destination(destination)
47+ , m_destination(std::move( destination) )
3948 {
4049 registerProxy ();
4150 }
4251
52+ ManagerProxy (const ManagerProxy&) = delete ;
53+ ManagerProxy& operator =(const ManagerProxy&) = delete ;
54+ ManagerProxy (ManagerProxy&&) = delete ;
55+ ManagerProxy& operator =(ManagerProxy&&) = delete ;
56+
4357 ~ManagerProxy ()
4458 {
4559 unregisterProxy ();
@@ -61,7 +75,7 @@ class ManagerProxy final : public sdbus::ProxyInterfaces<sdbus::ObjectManager_pr
6175 for (const auto & [interface, _] : interfacesAndProperties) {
6276 std::cout << interface << " " ;
6377 }
64- std::cout << std::endl ;
78+ std::cout << ' \n ' ;
6579
6680 // Parse and print some more info
6781 auto planetInterface = interfacesAndProperties.find (sdbus::InterfaceName{org::sdbuscpp::ExampleManager::Planet1_proxy::INTERFACE_NAME });
@@ -73,7 +87,7 @@ class ManagerProxy final : public sdbus::ProxyInterfaces<sdbus::ObjectManager_pr
7387 const auto & name = properties.at (sdbus::PropertyName{" Name" }).get <std::string>();
7488 // or create a proxy instance to the newly added object.
7589 PlanetProxy planet (m_connection, m_destination, objectPath);
76- std::cout << name << " has a population of " << planet.GetPopulation () << " .\n " << std::endl ;
90+ std::cout << name << " has a population of " << planet.GetPopulation () << " .\n " << ' \n ' ;
7791 }
7892
7993 void onInterfacesRemoved ( const sdbus::ObjectPath& objectPath
@@ -83,7 +97,7 @@ class ManagerProxy final : public sdbus::ProxyInterfaces<sdbus::ObjectManager_pr
8397 for (const auto & interface : interfaces) {
8498 std::cout << interface << " " ;
8599 }
86- std::cout << std::endl ;
100+ std::cout << ' \n ' ;
87101 }
88102
89103 sdbus::IConnection& m_connection;
@@ -102,7 +116,7 @@ int main()
102116 }
103117 catch (const sdbus::Error& e) {
104118 if (e.getName () == " org.freedesktop.DBus.Error.ServiceUnknown" ) {
105- std::cout << " Waiting for server to start ..." << std::endl ;
119+ std::cout << " Waiting for server to start ..." << ' \n ' ;
106120 }
107121 }
108122
0 commit comments