summaryrefslogtreecommitdiffstats
path: root/lib/CommLayer/CommLayerServer.h
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-04-01 09:36:46 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-04-01 09:36:46 +0200
commit42657326fdf8db194013094537d9386830fe5876 (patch)
treea81cde5aa03cc72950987c4eaa29d0461696a3d4 /lib/CommLayer/CommLayerServer.h
parentd879ebf08c48bbe8ed9bd344fceee9163fe464da (diff)
downloadabrt-42657326fdf8db194013094537d9386830fe5876.tar.gz
abrt-42657326fdf8db194013094537d9386830fe5876.tar.xz
abrt-42657326fdf8db194013094537d9386830fe5876.zip
Added commlayer to make dbus optional
Diffstat (limited to 'lib/CommLayer/CommLayerServer.h')
-rw-r--r--lib/CommLayer/CommLayerServer.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/CommLayer/CommLayerServer.h b/lib/CommLayer/CommLayerServer.h
new file mode 100644
index 0000000..bc4082f
--- /dev/null
+++ b/lib/CommLayer/CommLayerServer.h
@@ -0,0 +1,49 @@
+#include <vector>
+#include <map>
+#include <string>
+#include <sstream>
+#include "MiddleWare.h"
+#include "Observer.h"
+
+
+//typedef std::vector<crash_info_t> vector_crash_infos_t;
+typedef std::vector< std::vector<std::string> > dbus_vector_crash_infos_t;
+typedef std::vector< std::map<std::string, std::string> > dbus_vector_map_crash_infos_t;
+typedef std::map<std::string, std::string> dbus_map_report_info_t;
+
+/* just a helper function */
+template< class T >
+std::string
+to_string( T x )
+{
+ std::ostringstream o;
+ o << x;
+ return o.str();
+}
+
+class CCommLayerServer{
+ private:
+ /* FIXME more observers? */
+ //std::vector<Observer *obs>;
+ CObserver *m_pObserver;
+ public:
+ CMiddleWare *m_pMW;
+ CCommLayerServer(CMiddleWare *pMW);
+ ~CCommLayerServer();
+ /* observer */
+ void Attach(CObserver *pObs);
+ void Detach(CObserver *pObs);
+ void Notify(const std::string& pMessage);
+ /*
+ virtual dbus_vector_crash_infos_t GetCrashInfos(const std::string &pUID) = 0;
+ virtual dbus_vector_map_crash_infos_t GetCrashInfosMap(const std::string &pDBusSender) = 0;
+ virtual dbus_map_report_info_t CreateReport(const std::string &pUUID,const std::string &pDBusSender) = 0;
+ virtual bool Report(dbus_map_report_info_t pReport) = 0;
+ virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pDBusSender) = 0;
+ */
+ public:
+ /* just stubs to be called when not implemented in specific comm layer */
+ void Crash(const std::string& arg1) {}
+ void AnalyzeComplete(dbus_map_report_info_t arg1) {}
+ void Error(const std::string& arg1) {}
+};