22 #ifndef MYTHEVENTHANDLER_H 23 #define MYTHEVENTHANDLER_H 25 #include "mythtypes.h" 29 #define EVENTHANDLER_CONNECTED "CONNECTED" 30 #define EVENTHANDLER_DISCONNECTED "DISCONNECTED" 31 #define EVENTHANDLER_STOPPED "STOPPED" 32 #define EVENTHANDLER_NOTCONNECTED "NOTCONNECTED" 33 #define EVENTHANDLER_TIMEOUT 1 // 1 sec 42 virtual void HandleBackendMessage(EventMessagePtr msg) = 0;
50 bool Start() {
return m_imp->Start(); }
51 void Stop() { m_imp->Stop(); }
52 void Reset() { m_imp->Reset(); }
53 std::string GetServer()
const {
return m_imp->GetServer(); }
54 unsigned GetPort()
const {
return m_imp->GetPort(); }
55 bool IsRunning() {
return m_imp->IsRunning(); }
56 bool IsConnected() {
return m_imp->IsConnected(); }
58 unsigned CreateSubscription(
EventSubscriber *sub) {
return m_imp->CreateSubscription(sub); }
59 bool SubscribeForEvent(
unsigned subid, EVENT_t event) {
return m_imp->SubscribeForEvent(subid, event);}
60 void RevokeSubscription(
unsigned subid) { m_imp->RevokeSubscription(subid); }
61 void RevokeAllSubscriptions(
EventSubscriber *sub) { m_imp->RevokeAllSubscriptions(sub); }
69 virtual std::string GetServer()
const {
return m_server; }
70 virtual unsigned GetPort()
const {
return m_port; }
71 virtual bool Start() = 0;
72 virtual void Stop() = 0;
73 virtual void Reset() = 0;
74 virtual bool IsRunning() = 0;
75 virtual bool IsConnected() = 0;
77 virtual bool SubscribeForEvent(
unsigned subid, EVENT_t event) = 0;
78 virtual void RevokeSubscription(
unsigned subid) = 0;
86 typedef MYTH_SHARED_PTR<EventHandlerThread> EventHandlerThreadPtr;
89 EventHandlerThreadPtr m_imp;
This is the main namespace that encloses all public classes.