2016-02-15 18:25:18 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// STL includes
|
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <limits>
|
|
|
|
|
|
|
|
// QT includes
|
|
|
|
#include <QList>
|
|
|
|
#include <QStringList>
|
2016-02-15 20:53:03 +01:00
|
|
|
#include <QHostAddress>
|
2016-02-15 18:25:18 +01:00
|
|
|
|
|
|
|
// Utils includes
|
|
|
|
#include <utils/ColorRgb.h>
|
|
|
|
class MessageForwarder
|
|
|
|
{
|
|
|
|
public:
|
2016-02-15 20:53:03 +01:00
|
|
|
|
|
|
|
struct JsonSlaveAddress {
|
|
|
|
QHostAddress addr;
|
2016-02-16 14:16:59 +01:00
|
|
|
quint16 port;
|
2016-02-15 20:53:03 +01:00
|
|
|
};
|
|
|
|
|
2016-02-15 18:25:18 +01:00
|
|
|
MessageForwarder();
|
|
|
|
~MessageForwarder();
|
|
|
|
|
|
|
|
void addJsonSlave(std::string slave);
|
|
|
|
void addProtoSlave(std::string slave);
|
2016-02-19 13:31:08 +01:00
|
|
|
|
|
|
|
bool protoForwardingEnabled();
|
2016-09-07 20:10:37 +02:00
|
|
|
bool jsonForwardingEnabled();
|
|
|
|
bool forwardingEnabled() { return jsonForwardingEnabled() || protoForwardingEnabled(); };
|
2016-02-15 18:25:18 +01:00
|
|
|
QStringList getProtoSlaves();
|
2016-02-15 20:53:03 +01:00
|
|
|
QList<MessageForwarder::JsonSlaveAddress> getJsonSlaves();
|
2016-02-15 18:25:18 +01:00
|
|
|
|
|
|
|
private:
|
2016-02-15 20:53:03 +01:00
|
|
|
QStringList _protoSlaves;
|
|
|
|
QList<MessageForwarder::JsonSlaveAddress> _jsonSlaves;
|
2016-02-15 18:25:18 +01:00
|
|
|
};
|