connectioninfomanager.h
来自「天之炼狱1服务器端源文件游戏服务端不完整」· C头文件 代码 · 共 51 行
H
51 行
//////////////////////////////////////////////////////////////////////////////// Filename : ConnectionInfoManager.h// Written By : Reiot// Description ://////////////////////////////////////////////////////////////////////////////#ifndef __CONNECTION_INFO_MANAGER_H__#define __CONNECTION_INFO_MANAGER_H__#include "Types.h"#include "Exception.h"#include "Mutex.h"#include <hash_map>#include "ConnectionInfo.h"typedef hash_map< string, ConnectionInfo* > HashMapConnectionInfo;//////////////////////////////////////////////////////////////////////////////// class ConnectionInfoManager;// IP 胶飘傅阑 虐蔼栏肺 窍绰 hash_map 阑 郴何俊 啊瘤绊 乐促.//////////////////////////////////////////////////////////////////////////////class ConnectionInfoManager {public: ConnectionInfoManager() throw(); ~ConnectionInfoManager() throw();public: void addConnectionInfo(ConnectionInfo* pConnectionInfo) throw(DuplicatedException, Error); void deleteConnectionInfo(const string& ip) throw(NoSuchElementException, Error); ConnectionInfo* getConnectionInfo(const string& ip) throw(NoSuchElementException, Error); void heartbeat() throw(Error); string toString() const throw();private: // hash map of ConnectionInfo // key is ip-string HashMapConnectionInfo m_ConnectionInfos; Timeval m_NextHeartbeat; Timeval m_UpdateUserStatusTime; // 齿付喉侩 by sigi. 2002.11.4 mutable Mutex m_Mutex;};// global variable declarationextern ConnectionInfoManager* g_pConnectionInfoManager;#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?