summaryrefslogtreecommitdiffstats
path: root/lib/CommLayer/DBusServerProxy.h
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-08-06 16:19:07 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-08-06 16:19:07 +0200
commit84348ccea878d509f838927e1bf393e5443d3ac8 (patch)
treed7dc8bdc80b18a6137f94415761ec95c1df8e005 /lib/CommLayer/DBusServerProxy.h
parent9a3268d970142f0dfb4e3e77c66c9637bf87fbda (diff)
parent26c6665308b5a99d02308099118b23b2716dacc0 (diff)
downloadabrt-84348ccea878d509f838927e1bf393e5443d3ac8.tar.gz
abrt-84348ccea878d509f838927e1bf393e5443d3ac8.tar.xz
abrt-84348ccea878d509f838927e1bf393e5443d3ac8.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Conflicts: lib/CommLayer/DBusServerProxy.h
Diffstat (limited to 'lib/CommLayer/DBusServerProxy.h')
-rw-r--r--lib/CommLayer/DBusServerProxy.h197
1 files changed, 21 insertions, 176 deletions
diff --git a/lib/CommLayer/DBusServerProxy.h b/lib/CommLayer/DBusServerProxy.h
index 157a95f..78fb28b 100644
--- a/lib/CommLayer/DBusServerProxy.h
+++ b/lib/CommLayer/DBusServerProxy.h
@@ -16,83 +16,35 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifndef DBUSSERVERPROXY_H_
+#define DBUSSERVERPROXY_H_
+
#include <dbus-c++/dbus.h>
#include <dbus-c++/glib-integration.h>
#include "DBusCommon.h"
-#include <map>
-#include <iostream>
-#include <stdlib.h>
class CDBusServer_adaptor
: public DBus::InterfaceAdaptor
{
public:
-
- CDBusServer_adaptor()
- : DBus::InterfaceAdaptor(CC_DBUS_IFACE)
- {
- register_method(CDBusServer_adaptor, GetCrashInfos, _GetCrashInfos_stub);
- register_method(CDBusServer_adaptor, CreateReport, _CreateReport_stub);
- register_method(CDBusServer_adaptor, Report, _Report_stub);
- register_method(CDBusServer_adaptor, DeleteDebugDump, _DeleteDebugDump_stub);
- register_method(CDBusServer_adaptor, GetJobResult, _GetJobResult_stub);
- register_method(CDBusServer_adaptor, GetPluginsInfo, _GetPluginsInfo_stub);
- }
+ CDBusServer_adaptor();
/* reveal Interface introspection when we stabilize the API */
/*
- DBus::IntrospectedInterface *const introspect() const
- {
- static DBus::IntrospectedArgument GetCrashInfos_args[] =
- {
- //{ "uid", "i", true},
- { "info", "a{ss}", false },
- { 0, 0, 0 }
- };
- static DBus::IntrospectedArgument Crash_args[] =
- {
- { "package", "s", false },
- { 0, 0, 0 }
- };
- static DBus::IntrospectedMethod CDBusServer_adaptor_methods[] =
- {
- { "GetCrashInfos", GetCrashInfos_args },
- { 0, 0 },
- { "GetCrashInfosMap", GetCrashInfos_args },
- { 0, 0 }
- };
- static DBus::IntrospectedMethod CDBusServer_adaptor_signals[] =
- {
- { "Crash", Crash_args },
- { 0, 0 }
- };
- static DBus::IntrospectedProperty CDBusServer_adaptor_properties[] =
- {
- { 0, 0, 0, 0 }
- };
- static DBus::IntrospectedInterface CDBusServer_adaptor_interface =
- {
- "com.redhat.abrt",
- CDBusServer_adaptor_methods,
- CDBusServer_adaptor_signals,
- CDBusServer_adaptor_properties
- };
- return &CDBusServer_adaptor_interface;
- }
+ DBus::IntrospectedInterface *const introspect() const;
*/
-public:
+public:
/* properties exposed by this interface, use
* property() and property(value) to get and set a particular property
*/
public:
-
/* methods exported by this interface,
* you will have to implement them in your ObjectAdaptor
*/
virtual vector_crash_infos_t GetCrashInfos(const std::string &pDBusSender) = 0;
- virtual map_crash_report_t CreateReport(const std::string &pUUID,const std::string &pDBusSender) = 0;
- virtual uint64_t CreateReport_t(const std::string &pUUID,const std::string &pDBusSender) = 0;
+ virtual map_crash_report_t CreateReport(const std::string &pUUID, const std::string &pDBusSender) = 0;
+ virtual uint64_t CreateReport_t(const std::string &pUUID, const std::string &pDBusSender) = 0;
virtual bool Report(map_crash_report_t pReport, const std::string &pDBusSender) = 0;
virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pDBusSender) = 0;
virtual map_crash_report_t GetJobResult(uint64_t pJobID, const std::string& pDBusSender) = 0;
@@ -102,130 +54,23 @@ public:
/* signal emitters for this interface
*/
/* Notify the clients (UI) about a new crash */
- void Crash(const std::string& arg1)
- {
- ::DBus::SignalMessage sig("Crash");
- ::DBus::MessageIter wi = sig.writer();
- wi << arg1;
- emit_signal(sig);
- }
+ void Crash(const std::string& arg1);
/* Notify the clients that creating a report has finished */
- void AnalyzeComplete(map_crash_report_t arg1)
- {
- ::DBus::SignalMessage sig("AnalyzeComplete");
- ::DBus::MessageIter wi = sig.writer();
- wi << arg1;
- emit_signal(sig);
- }
-
-
- void JobDone(const std::string &pDest, uint64_t job_id)
- {
- ::DBus::SignalMessage sig("JobDone");
- ::DBus::MessageIter wi = sig.writer();
- wi << pDest;
- wi << job_id;
- emit_signal(sig);
- }
-
- void Error(const std::string& arg1)
- {
- ::DBus::SignalMessage sig("Error");
- ::DBus::MessageIter wi = sig.writer();
- wi << arg1;
- emit_signal(sig);
- }
-
- void Update(const std::string pDest, const std::string& pMessage)
- {
- ::DBus::SignalMessage sig("Update");
- ::DBus::MessageIter wi = sig.writer();
- wi << pDest;
- wi << pMessage;
- emit_signal(sig);
- }
-
- void Warning(const std::string& arg1)
- {
- ::DBus::SignalMessage sig("Warning");
- ::DBus::MessageIter wi = sig.writer();
- wi << arg1;
- emit_signal(sig);
- }
+ void AnalyzeComplete(map_crash_report_t arg1);
+ void JobDone(const std::string &pDest, uint64_t job_id);
+ void Error(const std::string& arg1);
+ void Update(const std::string pDest, const std::string& pMessage);
+ void Warning(const std::string& arg1);
private:
-
/* unmarshalers (to unpack the DBus message before calling the actual interface method)
*/
- DBus::Message _GetCrashInfos_stub(const DBus::CallMessage &call)
- {
- DBus::MessageIter ri = call.reader();
- //FIXME: @@@REMOVE!!
- vector_crash_infos_t argout1 = GetCrashInfos(call.sender());
- DBus::ReturnMessage reply(call);
- DBus::MessageIter wi = reply.writer();
- wi << argout1;
- return reply;
- }
-
- DBus::Message _CreateReport_stub(const DBus::CallMessage &call)
- {
- DBus::MessageIter ri = call.reader();
-
- std::string argin1; ri >> argin1;
- uint64_t argout1 = CreateReport_t(argin1,call.sender());
- if(sizeof (uint64_t) != 8) abort ();
- //map_crash_report_t argout1 = CreateReport(argin1,call.sender());
- DBus::ReturnMessage reply(call);
- DBus::MessageIter wi = reply.writer();
- wi << argout1;
- return reply;
- }
-
- DBus::Message _Report_stub(const DBus::CallMessage &call)
- {
- DBus::MessageIter ri = call.reader();
-
- map_crash_report_t argin1; ri >> argin1;
- bool argout1 = Report(argin1, call.sender());
- DBus::ReturnMessage reply(call);
- DBus::MessageIter wi = reply.writer();
- wi << argout1;
- return reply;
- }
-
- DBus::Message _DeleteDebugDump_stub(const DBus::CallMessage &call)
- {
- DBus::MessageIter ri = call.reader();
-
- std::string argin1; ri >> argin1;
- bool argout1 = DeleteDebugDump(argin1,call.sender());
- DBus::ReturnMessage reply(call);
- DBus::MessageIter wi = reply.writer();
- wi << argout1;
- return reply;
- }
-
- DBus::Message _GetJobResult_stub(const DBus::CallMessage &call)
- {
- DBus::MessageIter ri = call.reader();
- uint64_t job_id;
- ri >> job_id;
- map_crash_report_t report = GetJobResult(job_id,call.sender());
- DBus::ReturnMessage reply(call);
- DBus::MessageIter wi = reply.writer();
- wi << report;
- return reply;
- }
-
- DBus::Message _GetPluginsInfo_stub(const DBus::CallMessage &call)
- {
- vector_map_string_string_t plugins_info;
- plugins_info = GetPluginsInfo();
- DBus::ReturnMessage reply(call);
- DBus::MessageIter wi = reply.writer();
- wi << plugins_info;
- return reply;
- }
+ DBus::Message _GetCrashInfos_stub(const DBus::CallMessage &call);
+ DBus::Message _CreateReport_stub(const DBus::CallMessage &call);
+ DBus::Message _Report_stub(const DBus::CallMessage &call);
+ DBus::Message _DeleteDebugDump_stub(const DBus::CallMessage &call);
+ DBus::Message _GetJobResult_stub(const DBus::CallMessage &call);
+ DBus::Message _GetPluginsInfo_stub(const DBus::CallMessage &call);
};
+#endif