summaryrefslogtreecommitdiffstats
path: root/lib/CommLayer/CommLayerServer.h
blob: fc76cc95ef759af5707039c01cd5befb80a112f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <vector>
#include <map>
#include <string>
#include <sstream>
#include <iostream>
#include "MiddleWare.h"
#include "Observer.h"

/* 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);
        virtual ~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 */
        virtual void Crash(const std::string& arg1) {}
        virtual void AnalyzeComplete(map_crash_report_t arg1) {}
        virtual void Error(const std::string& arg1) {}
};