#pragma once #include class UpStream; class UpStreamMgr : public a8::Singleton { private: UpStreamMgr() {}; friend class a8::Singleton; public: void Init(); void UnInit(); std::weak_ptr GetConnByKey(const std::string& key); std::weak_ptr GetConnById(int instance_id); std::weak_ptr RecreateUpStream(const std::string& host, int port); private: unsigned short curr_id_ = 1000; std::map> key_hash_; std::map> id_hash_; };