| 1234567891011121314151617181920212223242526272829303132333435363738 |
- #ifndef MQTT_H
- #define MQTT_H
- #include "MQTTMessage.h"
- #include <functional>
- #include <memory>
- #include <string>
- namespace MQTT {
- class MQTTImpl;
- class MQTT
- {
- public:
- MQTT(const std::string& hostname, int port);
- ~MQTT();
- MQTT(const MQTT&) = delete;
- public:
- typedef std::function<void(const MQTTMessage&)> CallbackMethod;
- public:
- bool Send(const MQTTMessage& 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
|