#pragma once class CDNUserSession; namespace MasterSystem { const DWORD CACHETICK = (1000*30); // 30ΓΚ const DWORD CACHECLEARTICK = (1000*60*10); // 10ΊΠ class CCacheRepository:public CSingleton { public: CCacheRepository():m_dwCacheTick(0),m_uiCacheClearCount(0) { } void GetMasterList( CDNUserSession* pSession, UINT uiPage, BYTE cJob, BYTE cGender ); void SetMasterList( CDNUserSession* pSession, TAGetPageMasterCharacter* pData ); void GetMasterCharacter( CDNUserSession* pSession, INT64 biCharacterDBID ); void SetMasterCharacter( CDNUserSession* pSession, TAGetMasterCharacterType1* pData ); void GetMyMasterInfo( CDNUserSession* pSession, INT64 biPupilCharacterDBID, INT64 biMasterCharacterDBID, bool bRefresh ); void SetMyMasterInto( CDNUserSession* pSession, TAGetMasterCharacterType2* pData ); const TPupilInfo* GetPupilInfo( INT64 biMasterCharacterDBID, INT64 biPupilCharacterDBID ); void GetPupilList( CDNUserSession* pSession, INT64 biCharacterDBID, bool bRefresh ); void SetPupilList( CDNUserSession* pSession, TAGetListPupil* pData ); void GetMasterClassmateList( CDNUserSession* pSession, INT64 biCharacterDBID, bool bRefresh ); void SetMasterClassmateList( CDNUserSession* pSession, TAGetListMyMasterAndClassmate* pData ); void GetClassmateInfo( CDNUserSession* pSession, INT64 biClassmateCharacterDBID, bool bRefresh ); void SetClassmateInfo( CDNUserSession* pSession, TAGetMyClassmate* pData ); TCommunityLocation GetLocationInfo( INT64 biCharacterDBID ); void SetRegisterMaster( CDNUserSession* pSession, TAAddMasterCharacter* pData ); void SetRegisterMaster( CDNUserSession* pSession, TADelMasterCharacter* pData ); void ClearCache(); private: CSyncLock m_Sync; DWORD m_dwCacheTick; UINT m_uiCacheClearCount; //##################################################################################### // [0]MasterList //##################################################################################### // Key: : Value: //##################################################################################### typedef std::map< std::tr1::tuple, std::pair> > MMasterList; typedef MMasterList::iterator MMasterListItor; MMasterList m_mMasterList; //##################################################################################### // [1]PupilList //##################################################################################### // Key:MasterCharacterDBID : value: //##################################################################################### typedef std::map< INT64, std::pair> > MPupilList; typedef MPupilList::iterator MPupilListItor; MPupilList m_mPupilList; //##################################################################################### // [2]Master&Classmate List //##################################################################################### // Key:PupilCharacterDBID : value: //##################################################################################### typedef std::map< INT64, std::pair> > MMasterClassmateList; typedef MMasterClassmateList::iterator MMasterClassmateListItor; MMasterClassmateList m_mMasterClassmateList; //##################################################################################### // [3]ClassmateInfo //##################################################################################### // Key:CharacterDBID : value: //##################################################################################### typedef std::map< INT64, std::pair > MClassmateInfoList; typedef MClassmateInfoList::iterator MClassmateInfoListItor; MClassmateInfoList m_mClassmateList; //##################################################################################### // [4]MyMasterInfo //##################################################################################### // Key: : value: //##################################################################################### typedef std::map< std::pair, std::pair > MMyMasterInfoList; typedef MMyMasterInfoList::iterator MMyMasterInfoListItor; MMyMasterInfoList m_mMyMasterList; }; }