Files
2022-10-26 12:25:11 +08:00

35 lines
827 B
C++

#pragma once
#include "XMLParser.h"
#include <Singleton.h>
#include <map>
#include <ObjKeyGenerator.h>
class AgentInfo;
typedef std::map< DWORD, AgentInfo* > AGENT_INFO_MAP;
typedef AGENT_INFO_MAP::iterator AGENT_INFO_MAP_ITER;
class AgentInfoParser : public Singleton<AgentInfoParser>
{
public:
AgentInfoParser(void);
~AgentInfoParser(void);
public:
BOOL Load( char* pszFileName );
VOID UnLoad();
AgentInfo * GetAgentInfo( DWORD dwAgentKey );
AgentInfo * GetAgentInfo( const TCHAR* pszIP );
BOOL Add( const TCHAR* pszIP, DWORD& dwKey );
BOOL Del( DWORD dwAgentKey );
BOOL Modify( DWORD dwKey, TCHAR* pszIP );
VOID SerializeStream( AGENT_TOTAL_INFO& info, BOOL bSave );
private:
XMLParser m_XMLParser;
AGENT_INFO_MAP m_mapAgentInfo;
util::CObjKeyGenerator<> m_KeyGenerator;
};