diff options
| author | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-04-02 16:24:46 +0200 |
|---|---|---|
| committer | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-04-02 16:24:46 +0200 |
| commit | 62a15a2e7cc5186661bef2ec172422989c72e5db (patch) | |
| tree | 8561ea8bfabbb1136a6ca7b222f18c7a6f343eb7 /lib/CommLayer | |
| parent | f02f0b3c6b8801584884fb2e4da0707417374185 (diff) | |
| download | abrt-62a15a2e7cc5186661bef2ec172422989c72e5db.tar.gz abrt-62a15a2e7cc5186661bef2ec172422989c72e5db.tar.xz abrt-62a15a2e7cc5186661bef2ec172422989c72e5db.zip | |
new crash types
Diffstat (limited to 'lib/CommLayer')
| -rw-r--r-- | lib/CommLayer/CommLayerServer.h | 8 | ||||
| -rw-r--r-- | lib/CommLayer/CommLayerServerDBus.cpp | 27 | ||||
| -rw-r--r-- | lib/CommLayer/CommLayerServerDBus.h | 6 | ||||
| -rw-r--r-- | lib/CommLayer/DBusClientProxy.h | 4 | ||||
| -rw-r--r-- | lib/CommLayer/DBusCommon.h | 6 | ||||
| -rw-r--r-- | lib/CommLayer/DBusServerProxy.h | 14 |
6 files changed, 27 insertions, 38 deletions
diff --git a/lib/CommLayer/CommLayerServer.h b/lib/CommLayer/CommLayerServer.h index fa8023a..e4a5170 100644 --- a/lib/CommLayer/CommLayerServer.h +++ b/lib/CommLayer/CommLayerServer.h @@ -5,12 +5,6 @@ #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 @@ -44,6 +38,6 @@ class CCommLayerServer{ 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 AnalyzeComplete(map_crash_report_t arg1) {} void Error(const std::string& arg1) {} }; diff --git a/lib/CommLayer/CommLayerServerDBus.cpp b/lib/CommLayer/CommLayerServerDBus.cpp index 33bb2f9..a62ed2e 100644 --- a/lib/CommLayer/CommLayerServerDBus.cpp +++ b/lib/CommLayer/CommLayerServerDBus.cpp @@ -26,21 +26,21 @@ CCommLayerServerDBus::~CCommLayerServerDBus() delete m_pDispatcher; } -dbus_vector_crash_infos_t CCommLayerServerDBus::GetCrashInfos(const std::string &pUID) +vector_crash_infos_t CCommLayerServerDBus::GetCrashInfos(const std::string &pUID) { - dbus_vector_crash_infos_t retval; - vector_crash_infos_t crash_info; + vector_crash_infos_t retval; + /* vector_crash_infos_t crash_info; m_pMW->GetCrashInfos("501"); for (vector_crash_infos_t::iterator it = crash_info.begin(); it!=crash_info.end(); ++it) { std::cerr << it->m_sExecutable << std::endl; - } + }*/ return retval; } dbus_vector_map_crash_infos_t CCommLayerServerDBus::GetCrashInfosMap(const std::string &pDBusSender) { dbus_vector_map_crash_infos_t retval; - vector_crash_infos_t crash_info; + /*vector_crash_infos_t crash_info; unsigned long unix_uid = m_pConn->sender_unix_uid(pDBusSender.c_str()); try { @@ -54,35 +54,32 @@ dbus_vector_map_crash_infos_t CCommLayerServerDBus::GetCrashInfosMap(const std:: std::cerr << it->m_sExecutable << std::endl; retval.push_back(it->GetMap()); } - Notify("Sent crash info"); + Notify("Sent crash info");*/ return retval; } -dbus_vector_crash_report_info_t CCommLayerServerDBus::CreateReport(const std::string &pUUID,const std::string &pDBusSender) +map_crash_report_t CCommLayerServerDBus::CreateReport(const std::string &pUUID,const std::string &pDBusSender) { - dbus_vector_crash_report_info_t retval; unsigned long unix_uid = m_pConn->sender_unix_uid(pDBusSender.c_str()); //std::cerr << pUUID << ":" << unix_uid << std::endl; - crash_report_t crashReport; + map_crash_report_t crashReport; std::cerr << "Creating report" << std::endl; try { m_pMW->CreateCrashReport(pUUID,to_string(unix_uid), crashReport); - retval = crash_report_to_vector_strings(crashReport); //send out the message about completed analyze - CDBusServer_adaptor::AnalyzeComplete(retval); + CDBusServer_adaptor::AnalyzeComplete(crashReport); } catch(std::string err) { CDBusServer_adaptor::Error(err); std::cerr << err << std::endl; } - return retval; + return crashReport; } -bool CCommLayerServerDBus::Report(dbus_vector_crash_report_info_t pReport) +bool CCommLayerServerDBus::Report(map_crash_report_t pReport) { - crash_report_t crashReport = vector_strings_to_crash_report(pReport); //#define FIELD(X) crashReport.m_s##X = pReport[#X]; //crashReport.m_sUUID = pReport["UUID"]; //ALL_CRASH_REPORT_FIELDS; @@ -92,7 +89,7 @@ bool CCommLayerServerDBus::Report(dbus_vector_crash_report_info_t pReport) //} try { - m_pMW->Report(crashReport); + m_pMW->Report(pReport); } catch(std::string err) { diff --git a/lib/CommLayer/CommLayerServerDBus.h b/lib/CommLayer/CommLayerServerDBus.h index 175be21..c5715c9 100644 --- a/lib/CommLayer/CommLayerServerDBus.h +++ b/lib/CommLayer/CommLayerServerDBus.h @@ -18,10 +18,10 @@ class CCommLayerServerDBus CCommLayerServerDBus(CMiddleWare *m_pMW); virtual ~CCommLayerServerDBus(); - virtual dbus_vector_crash_infos_t GetCrashInfos(const std::string &pUID); + virtual vector_crash_infos_t GetCrashInfos(const std::string &pUID); virtual dbus_vector_map_crash_infos_t GetCrashInfosMap(const std::string &pDBusSender); - virtual dbus_vector_crash_report_info_t CreateReport(const std::string &pUUID,const std::string &pDBusSender); - virtual bool Report(dbus_vector_crash_report_info_t pReport); + virtual map_crash_report_t CreateReport(const std::string &pUUID,const std::string &pDBusSender); + virtual bool Report(map_crash_report_t pReport); virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pDBusSender); }; diff --git a/lib/CommLayer/DBusClientProxy.h b/lib/CommLayer/DBusClientProxy.h index f0b8a00..4bbf5ee 100644 --- a/lib/CommLayer/DBusClientProxy.h +++ b/lib/CommLayer/DBusClientProxy.h @@ -50,7 +50,7 @@ public: ... > */ - dbus_vector_crash_infos_t GetCrashInfos(const std::string &pUID) + vector_crash_infos_t GetCrashInfos(const std::string &pUID) { DBus::CallMessage call; @@ -61,7 +61,7 @@ public: DBus::Message ret = invoke_method(call); DBus::MessageIter ri = ret.reader(); - dbus_vector_crash_infos_t argout; + vector_crash_infos_t argout; ri >> argout; return argout; } diff --git a/lib/CommLayer/DBusCommon.h b/lib/CommLayer/DBusCommon.h index acd508d..0f58abc 100644 --- a/lib/CommLayer/DBusCommon.h +++ b/lib/CommLayer/DBusCommon.h @@ -21,8 +21,6 @@ #define CC_DBUS_PATH "/com/redhat/abrt" #define CC_DBUS_IFACE "com.redhat.abrt" -//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; -typedef std::vector<std::string> dbus_vector_crash_report_info_t; + +#include "CrashTypes.h" diff --git a/lib/CommLayer/DBusServerProxy.h b/lib/CommLayer/DBusServerProxy.h index f1c011a..2d52d15 100644 --- a/lib/CommLayer/DBusServerProxy.h +++ b/lib/CommLayer/DBusServerProxy.h @@ -88,10 +88,10 @@ public: /* methods exported by this interface, * you will have to implement them in your ObjectAdaptor */ - virtual dbus_vector_crash_infos_t GetCrashInfos(const std::string &pUID) = 0; + virtual 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_vector_crash_report_info_t CreateReport(const std::string &pUUID,const std::string &pDBusSender) = 0; - virtual bool Report(dbus_vector_crash_report_info_t pReport) = 0; + virtual map_crash_report_t CreateReport(const std::string &pUUID,const std::string &pDBusSender) = 0; + virtual bool Report(map_crash_report_t pReport) = 0; virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pDBusSender) = 0; public: @@ -106,7 +106,7 @@ public: emit_signal(sig); } /* Notify the clients that creating a report has finished */ - void AnalyzeComplete(dbus_vector_crash_report_info_t arg1) + void AnalyzeComplete(map_crash_report_t arg1) { ::DBus::SignalMessage sig("AnalyzeComplete"); ::DBus::MessageIter wi = sig.writer(); @@ -131,7 +131,7 @@ private: DBus::MessageIter ri = call.reader(); std::string argin1; ri >> argin1; - dbus_vector_crash_infos_t argout1 = GetCrashInfos(argin1); + vector_crash_infos_t argout1 = GetCrashInfos(argin1); DBus::ReturnMessage reply(call); DBus::MessageIter wi = reply.writer(); wi << argout1; @@ -143,7 +143,7 @@ private: DBus::MessageIter ri = call.reader(); std::string argin1; ri >> argin1; - dbus_vector_crash_report_info_t argout1 = CreateReport(argin1,call.sender()); + map_crash_report_t argout1 = CreateReport(argin1,call.sender()); DBus::ReturnMessage reply(call); DBus::MessageIter wi = reply.writer(); wi << argout1; @@ -166,7 +166,7 @@ private: { DBus::MessageIter ri = call.reader(); - dbus_vector_crash_report_info_t argin1; ri >> argin1; + map_crash_report_t argin1; ri >> argin1; bool argout1 = Report(argin1); DBus::ReturnMessage reply(call); DBus::MessageIter wi = reply.writer(); |
