#pragma once
#include <myapp/logging/logger.h>
#include "dataaccess.h"
#include "poll.h"
#include <memory>
#include <string>

namespace myapp::modbus {

class connection
{
public:
    static std::shared_ptr<connection> create(
        std::shared_ptr<logging::logger>,
        std::string const& connection_string);

    virtual ~connection() = default;
    virtual void connect() = 0;
    virtual void close() = 0;

    virtual std::shared_ptr<poll> get_poller() noexcept = 0;
    virtual std::shared_ptr<data_access> get_data_access() noexcept = 0;
};

} /* namespace myapp::modbus */
