summaryrefslogtreecommitdiff
path: root/LayerManagerPlugins
diff options
context:
space:
mode:
authorMichael Schuldt <michael.schuldt@bmw-carit.de>2011-08-25 08:48:15 +0200
committerMichael Schuldt <michael.schuldt@bmw-carit.de>2011-09-08 13:11:36 +0200
commit80c0b8dd151045d788e692c5c08c9a20c274f4ae (patch)
treeac7263570aedf43fb714ec41e8bad560158520f5 /LayerManagerPlugins
parentbb75af9426683ccd1eac860925ef7fc2ffd7aae0 (diff)
downloadlayer_management-80c0b8dd151045d788e692c5c08c9a20c274f4ae.tar.gz
Introducion of process function to dispatch Communication Messages
Sometime it is needed that you don't want to run the communicator in a own thread. Therefore it is needed that you can trigger read write to the communication message queue inside of the mainloop. Thatis the reason why we introduce the new process method in the ICommunicator interface and provides a reference implementation inside of the DBUSCommunicator.
Diffstat (limited to 'LayerManagerPlugins')
-rw-r--r--LayerManagerPlugins/Communicators/DBUSCommunicator/include/DBUSCommunicator.h1
-rw-r--r--LayerManagerPlugins/Communicators/DBUSCommunicator/src/DBUSCommunicator.cpp5
2 files changed, 5 insertions, 1 deletions
diff --git a/LayerManagerPlugins/Communicators/DBUSCommunicator/include/DBUSCommunicator.h b/LayerManagerPlugins/Communicators/DBUSCommunicator/include/DBUSCommunicator.h
index 825f21e..ce070e6 100644
--- a/LayerManagerPlugins/Communicators/DBUSCommunicator/include/DBUSCommunicator.h
+++ b/LayerManagerPlugins/Communicators/DBUSCommunicator/include/DBUSCommunicator.h
@@ -64,6 +64,7 @@ public:
DBUSCommunicator(ICommandExecutor* executor);
virtual bool start();
virtual void stop();
+ virtual void process();
virtual void setdebug(bool onoff);
void Debug(DBusConnection* conn, DBusMessage* msg);
diff --git a/LayerManagerPlugins/Communicators/DBUSCommunicator/src/DBUSCommunicator.cpp b/LayerManagerPlugins/Communicators/DBUSCommunicator/src/DBUSCommunicator.cpp
index c7a00d5..564c554 100644
--- a/LayerManagerPlugins/Communicators/DBUSCommunicator/src/DBUSCommunicator.cpp
+++ b/LayerManagerPlugins/Communicators/DBUSCommunicator/src/DBUSCommunicator.cpp
@@ -241,7 +241,10 @@ void DBUSCommunicator::ScreenShot(DBusConnection* conn, DBusMessage* msg)
g_pDbusMessage->ReplyError(msg, DBUS_ERROR_INVALID_ARGS, ID_UNKNOWN);
}
}
-
+void DBUSCommunicator::process()
+{
+ dbus_connection_read_write_dispatch (g_pDbusMessage->getConnection(), -1);
+}
void DBUSCommunicator::ScreenShotOfLayer(DBusConnection* conn, DBusMessage* msg)
{
(void)conn; // TODO: remove, only prevents warning