#pragma once

#include "mqtt_config_service.h"
#include "mqtt_message_router.h"
#include "mqtt_topics.h"

#include <memory>
#include <string>

namespace mqtt {

class Client {
public:
    Client(Topics topics, MessageRouter &router);
    ~Client();

    Client(const Client &) = delete;
    Client &operator=(const Client &) = delete;

    bool start(const RemoteConfig &config);
    void stop();
    int retry_failed();
    int publish_all(const std::string &topic, const std::string &payload,
                    int qos = 0, bool retain = false);

private:
    class Impl;
    std::unique_ptr<Impl> impl_;
};

} // namespace mqtt
