first version of InternalUDPService

This commit is contained in:
Henry Winkel
2022-11-12 14:23:12 +01:00
parent 3006f79883
commit 84305eb7fa
16 changed files with 1924 additions and 136 deletions

View File

@@ -54,7 +54,7 @@ namespace WHISPER
/// variable indicating if the receiveThread should be stopped
std::atomic<bool> stopReceiveThread;
std::shared_ptr<threadSafeQueue<std::string>> receiveQueue = nullptr;
std::shared_ptr<threadSafeQueue<WHISPER::Message>> receiveQueue = nullptr;
@@ -63,24 +63,25 @@ namespace WHISPER
public:
whispercomm(std::uint32_t id, SourceType owndevicetype):ownID_(id),ownDeviceType_(owndevicetype)
{
receiveQueue = std::make_shared<threadSafeQueue<std::string>>();
};
void connect(std::shared_ptr<threadSafeQueue<std::string>> receiver);
void publish(std::string msg);
{};
void connect(std::shared_ptr<threadSafeQueue<WHISPER::Message>> receiver);
void publish(std::string msg,std::string topic);
void disconnect();
void subscribe(std::string topic);
void unsubscribe(std::string topic);
protected:
void addMsgToReceiverQueue(std::string);
void addMsgToReceiverQueue(WHISPER::Message);
void setGateway(bool);
virtual void derivedConnect() = 0;
virtual void derivedDisconnect() = 0;
virtual void derivedPublish(std::string msg,std::string topic) = 0;
virtual void derivedReceive() = 0;
virtual void derivedConnect() = 0;
virtual void derivedDisconnect() = 0;
virtual void derivedPublish(std::string msg) = 0;
virtual void derivedReceive() = 0;
virtual void derivedSubscribe(std::string topic) = 0;
virtual void derivedUnsubscribe(std::string topic) = 0;