summaryrefslogtreecommitdiff
path: root/examples/properties/propsgs-client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/properties/propsgs-client.cpp')
-rw-r--r--examples/properties/propsgs-client.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/examples/properties/propsgs-client.cpp b/examples/properties/propsgs-client.cpp
index d4b51f4..01eb403 100644
--- a/examples/properties/propsgs-client.cpp
+++ b/examples/properties/propsgs-client.cpp
@@ -9,64 +9,64 @@ static const char *PROPS_SERVER_NAME = "org.freedesktop.DBus.Examples.Properties
static const char *PROPS_SERVER_PATH = "/org/freedesktop/DBus/Examples/Properties";
PropsClient::PropsClient(DBus::Connection &connection, const char *path, const char *name)
-: DBus::ObjectProxy(connection, path, name)
+ : DBus::ObjectProxy(connection, path, name)
{
}
-void PropsClient::MessageChanged(const std::string& message)
+void PropsClient::MessageChanged(const std::string &message)
{
- std::cout << "MessageChanged signal, new value: " << message << "\n";
+ std::cout << "MessageChanged signal, new value: " << message << "\n";
};
-void PropsClient::DataChanged(const double& data)
+void PropsClient::DataChanged(const double &data)
{
- std::cout << "DataChanged signal, new value:" << data << "\n";
+ std::cout << "DataChanged signal, new value:" << data << "\n";
};
-void *test_property_proxy(void * input)
+void *test_property_proxy(void *input)
{
- PropsClient *client = static_cast<PropsClient*>(input);
+ PropsClient *client = static_cast<PropsClient *>(input);
- std::cout << "read property 'Version', value:" << client->Version() << "\n";
+ std::cout << "read property 'Version', value:" << client->Version() << "\n";
- std::cout << "read property 'Message', value:" << client->Message() << "\n";
-
- client->Message("message set by property access");
- std::cout << "wrote property 'Message'\n";
-
- std::cout << "read property 'Message', value:" << client->Message() << "\n";
-
- client->Data(1.1);
- std::cout << "wrote property 'Data'\n";
+ std::cout << "read property 'Message', value:" << client->Message() << "\n";
- return NULL;
+ client->Message("message set by property access");
+ std::cout << "wrote property 'Message'\n";
+
+ std::cout << "read property 'Message', value:" << client->Message() << "\n";
+
+ client->Data(1.1);
+ std::cout << "wrote property 'Data'\n";
+
+ return NULL;
}
DBus::BusDispatcher dispatcher;
void niam(int sig)
{
- dispatcher.leave();
- pthread_exit(NULL);
+ dispatcher.leave();
+ pthread_exit(NULL);
}
int main()
{
- signal(SIGTERM, niam);
- signal(SIGINT, niam);
+ signal(SIGTERM, niam);
+ signal(SIGINT, niam);
- DBus::default_dispatcher = &dispatcher;
+ DBus::default_dispatcher = &dispatcher;
- DBus::_init_threading();
+ DBus::_init_threading();
- DBus::Connection conn = DBus::Connection::SessionBus();
+ DBus::Connection conn = DBus::Connection::SessionBus();
- PropsClient client (conn, PROPS_SERVER_PATH, PROPS_SERVER_NAME);
+ PropsClient client(conn, PROPS_SERVER_PATH, PROPS_SERVER_NAME);
- pthread_t thread;
- pthread_create(&thread, NULL, test_property_proxy, &client);
+ pthread_t thread;
+ pthread_create(&thread, NULL, test_property_proxy, &client);
- dispatcher.enter();
+ dispatcher.enter();
- return 0;
+ return 0;
}