#ifndef _RYL_SERVER_BIND_RUN_ID_ #define _RYL_SERVER_BIND_RUN_ID_ #pragma warning(disable:4800) #include #include #include #include class CRylServerBindRunID { public: static CRylServerBindRunID& GetInstance(); bool SetID(unsigned long dwRunID, unsigned long dwServerID); bool RemoveFromRunID(unsigned long dwRunID); bool RemoveFromServerID(unsigned long dwServerID); bool GetRunID(unsigned long dwServerID, unsigned long* lpdwRunID); bool GetServerID(unsigned long dwRunID, unsigned long* lpdwServerID); void SetSetupFileName(const TCHAR* szSetupFileName); bool Save(); bool Load(); template void EnumID(FnProcess fnProcess) { BindIDTable::iterator pos = m_RunID.begin(); BindIDTable::iterator end = m_RunID.end(); for(; pos != end; ++pos) { // first : RunID, Second : ServerID fnProcess(pos->first, pos->second); } } size_t GetPairNum() const { return m_RunID.size(); } private: typedef std::pair BindID; typedef std::map, boost::fast_pool_allocator > > BindIDTable; CRylServerBindRunID(); ~CRylServerBindRunID(); BindIDTable m_RunID; // key : RunID, value : ServerID BindIDTable m_ServerID; // key : ServerID, value : RunID TCHAR m_szDefaultSetupFileName[MAX_PATH]; }; #endif