📄 databasemanager.h
字号:
//////////////////////////////////////////////////////////////////////////////// Filename : DatabaseManager.h// Written By : elca// Description : 单捞鸥海捞胶 概聪历//////////////////////////////////////////////////////////////////////////////#ifndef __DATABASE_MANAGER_H__#define __DATABASE_MANAGER_H__#include "Types.h"#include "Exception.h"#include <hash_map>#include "Connection.h"#include "Mutex.h"//////////////////////////////////////////////////////////////////////////////// class DatabaseManager;//////////////////////////////////////////////////////////////////////////////class DatabaseManager {public: DatabaseManager() throw(); ~DatabaseManager() throw(); public: void init() throw(Error); void addConnection(int TID, Connection * pConnection) throw(DuplicatedException); void addDistConnection(int TID, Connection * pConnection) throw(DuplicatedException); void addCBillingConnection(int TID, Connection * pConnection) throw(DuplicatedException);// void addPCRoomConnection(int TID, Connection * pConnection) throw(DuplicatedException); Connection* getConnection(const string& ip) throw(NoSuchElementException); Connection* getDistConnection(const string& ip) throw(NoSuchElementException); Connection* getCBillingConnection(const string& ip) throw(NoSuchElementException);// Connection* getPCRoomConnection(const string& ip) throw(NoSuchElementException); Connection* getUserInfoConnection(void) throw() { return m_pUserInfoConnection; } void executeDummyQuery(Connection* pConnection) throw (Error); //-------------------------------------------------------------------- // * elca's NOTE // 肺弊牢 辑滚俊辑绰 某腐磐狼 沥焊甫 绢叼辑 掘绢坷绰瘤 舅酒郴扁 困窍咯 // DB狼 困摹甫 舅酒郴 柯促. // 皋牢 DB俊辑绰 DB狼 困摹甫 器窃窍绰 Table捞 粮犁秦具 茄促. // GameServerIP肺 惶酒 尘 荐档 乐瘤父 DB客 GameServer啊 促弗 版快甫 // 积阿窍咯 犬厘己阑 绊妨茄促. //-------------------------------------------------------------------- //-------------------------------------------------------------------- // * elca's NOTE // 阿 霸烙 辑滚狼 版快 Parent/Main DB父阑 舅搁 等促. // 皋牢 DB 辑滚狼 岿靛 酒捞叼绰 公炼扒 0 锅捞扼绊 距沥窍绊 // 皋牢 DB 辑滚俊 孽府绰 0 锅 牢磊肺 逞变促. // 霸烙 辑滚老 版快 捞 0 锅狼 目池记父 啊瘤绊 乐栏搁 等促. // 趣矫唱 窍绰 滚弊狼 快妨啊 乐扁 锭巩俊 例措 促弗 目池记篮 凯瘤 臼档废 // 林狼 窍档废 茄促. // 老馆 霸烙 辑滚俊辑狼 孽府绰 静饭靛 喊肺 唱吹绢廉 乐扁 锭巩俊 // 脚版静瘤 臼档废 茄促. //-------------------------------------------------------------------- Connection* getConnection( int TID ) throw(NoSuchElementException);// void addConnection(WorldID_t WorldID, Connection * pConnection) throw(DuplicatedException);private: // 阿 静饭靛喊肺 粮犁窍绰 DB 楷搬 hash_map<int, Connection*> m_Connections; // 阿 静饭靛喊肺 粮犁窍绰 Distribute DB 楷搬 hash_map<int, Connection*> m_DistConnections;// hash_map<WorldID_t, Connection*> m_WorldConnections; hash_map<int, Connection*> m_WorldConnections; // 阿 静饭靛喊肺 粮犁窍绰 CBilling DB 楷搬 hash_map<int, Connection*> m_CBillingConnections; // PC规 烹钦侩 DB 楷搬// hash_map<int, Connection*> m_PCRoomConnections; // 阿 岿靛喊肺 粮犁窍绰 DB 楷搬 // 力老 贸澜 积己登绰 扁夯 DB 楷搬 Connection* m_pDefaultConnection; // 力老 贸澜 积己登绰 弥 惑困 DB狼 扁夯 楷搬 Connection* m_pWorldDefaultConnection; // 荤侩磊 烹拌 包访 DB 楷搬 Connection* m_pUserInfoConnection; Connection* m_pDistConnection; // PC规 烹钦侩 DB 楷搬 default. 肺弊牢 辑滚俊辑 敬促.// Connection* m_pPCRoomConnection; mutable Mutex m_Mutex;};extern DatabaseManager * g_pDatabaseManager;#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -