#ifndef HTTP_PUSH_HPP__
#define HTTP_PUSH_HPP__ 
#include "nodes/base/base.hpp"
#include <opencv2/opencv.hpp>
#include "common/threadPool.hpp"
namespace Node
{

class HttpPushNode : public BaseNode
{
public:
    HttpPushNode() = delete;
    HttpPushNode(const std::string& name) : BaseNode(name, NODE_TYPE::DES_NODE) {}
    HttpPushNode(const std::string& name, const std::string& ip, int port, const std::string& address)
            : BaseNode(name, NODE_TYPE::DES_NODE), ip_(ip), port_(port), address_(address) {}

    virtual ~HttpPushNode() { stop(); };

    inline void set_ip(const std::string& ip) { ip_ = ip; }
    inline void set_port(int port) { port_ = port; }
    inline void set_address(const std::string& address) { address_ = address; }
    // 初始化线程池
    inline void init_thread_pool(int num) 
    {
        thread_pool_ = std::make_shared<ThreadPool>(num);
    }

    void work() override;

private:
    std::string ip_;
    int port_;
    std::string address_;
    std::shared_ptr<ThreadPool> thread_pool_;
    
};

}

#endif // HTTP_PUSH_HPP__