26 lines
538 B
C++
26 lines
538 B
C++
#pragma once
|
|
|
|
#include <a8/singleton.h>
|
|
|
|
class UpStream;
|
|
class UpStreamMgr : public a8::Singleton<UpStreamMgr>
|
|
{
|
|
private:
|
|
UpStreamMgr() {};
|
|
friend class a8::Singleton<UpStreamMgr>;
|
|
|
|
public:
|
|
|
|
void Init();
|
|
void UnInit();
|
|
|
|
UpStream* GetConnByKey(const std::string& key);
|
|
UpStream* GetConnById(int instance_id);
|
|
UpStream* RecreateUpStream(const std::string& host, int port);
|
|
|
|
private:
|
|
unsigned short curr_id_ = 1000;
|
|
std::map<std::string, UpStream*> key_hash_;
|
|
std::map<int, UpStream*> id_hash_;
|
|
};
|