24 lines
533 B
C++
24 lines
533 B
C++
#pragma once
|
|
|
|
class TargetConn;
|
|
class TargetConnMgr : public a8::Singleton<TargetConnMgr>
|
|
{
|
|
private:
|
|
TargetConnMgr() {};
|
|
friend class a8::Singleton<TargetConnMgr>;
|
|
|
|
public:
|
|
|
|
void Init();
|
|
void UnInit();
|
|
|
|
TargetConn* GetConnByKey(const std::string& key);
|
|
TargetConn* GetConnById(int instance_id);
|
|
TargetConn* RecreateTargetConn(const std::string& host, int port);
|
|
|
|
private:
|
|
unsigned short curr_id_ = 1000;
|
|
std::map<std::string, TargetConn*> key_hash_;
|
|
std::map<int, TargetConn*> id_hash_;
|
|
};
|