3 #include <Poco/SharedPtr.h>
4 #include <Poco/Timespan.h>
6 #include "gwmessage/GWMessage.h"
7 #include "server/GWSListener.h"
8 #include "util/EventSource.h"
23 typedef Poco::SharedPtr<GWSConnector> Ptr;
33 virtual void send(
const GWMessage::Ptr message) = 0;
53 template <
typename Event,
typename Method>
54 void fireEvent(
const Event &e,
const Method &m)
56 m_eventSource.fireEvent(e, m);
59 void fireReceived(
const GWMessage::Ptr message);
void addListener(GWSListener::Ptr listener)
Register a GWSListener instance that would receive events related to the communication.
Definition: GWSConnector.cpp:36
EventSource implements common logic for firing events to listeners.
Definition: EventSource.h:24
virtual void send(const GWMessage::Ptr message)=0
Send the given message to the remote server. The actual sending operation might be delayed and thus t...
void setEventsExecutor(AsyncExecutor::Ptr executor)
Configure an AsyncExecutor instance that would be used for GWSListener events delivery.
Definition: GWSConnector.cpp:46
GWSConnector is an abstract class that defines an API for communication with a remote server...
Definition: GWSConnector.h:21
void clearListeners()
Remove all registered listeners.
Definition: GWSConnector.cpp:41