| 123456789101112131415161718192021222324252627282930313233343536 |
- #ifndef MQTT_H
- #define MQTT_H
- #include "Message.h"
- #include <functional>
- #include <memory>
- #include <string>
- namespace MQTT {
- class MQTTImpl;
- class MQTT
- {
- public:
- MQTT(const std::string& hostname, int port);
- ~MQTT();
- public:
- typedef std::function<void(const Message&)> CallbackMethod;
- public:
- bool Send(const Message& message);
- bool Subscribe(const std::string& topic);
- void Unsubscribe(const std::string& topic);
- size_t Connect(CallbackMethod function);
- void Disconnect(size_t connection);
- private:
- std::unique_ptr<MQTTImpl> m_pMQTTImpl;
- };
- } // namespace MQTT
- #endif // MQTT_H
|