#ifndef ___CDYMONITORLOCAL_H__ #define ___CDYMONITORLOCAL_H__ /* #ifdef _WINDOWS64 #ifdef DY_MONITOR_DLL_LOCAL_EXPORTS #define DY_MONITOR_DLL_LOCAL_API __declspec(dllexport) #else #define DY_MONITOR_DLL_LOCAL_API __declspec(dllimport) #endif #else #define DY_MONITOR_DLL_LOCAL_API #endif */ #include "dy_monitor_define.h" #include "CDyMonitorShm.h" class CDyMonitorLocal { public: CDyMonitorLocal(); ~CDyMonitorLocal(); //初始化信号量,读取dy_config.sys int InitDyMonitorLocal(); //不初始化信号量,仅为读取dy_config.sys用,与InitDyMonitorLocal()只能2选1 int InitDyLoginParaInfo(); //get info from shm int GetMasterDyInfo (string strDysName, TLoginDyInfo &masterDyInfo); int GetMasterDyInfo (string dy_name,string strDysName, TLoginDyInfo &masterDyInfo); int GetDyNum (int &nSize); int GetAllDyServerInfo (vector &dyServerInfoVec); int GetAllDyServerInfo (const string strDyName,vector &dyServerInfoVec); int getIndexByServiceName (string service_name) ; int getIndexByServiceName (const string dy_name,const string service_name) ; //get info from dy_config.sys int GetAllDySNameFromCfg(string strDyName,vector& dySNameVec); int GetAllDyNameFromCfg (vector& vec_dy_names); int GetDyNumFromCfg(int &nSize); int GetDyServerInfoByIndex (const int index,TLoginDyInfo& dyServerInfo); private: int getIndexByDyName (const string dy_name) ; string gDyIntToStr (int nVal); int ReadDyConfigInfoLocal(); int StringCopy (char *des, const char *src, int max_len); vector m_dy_config_info; vector m_vec_dy_names;//按配置顺序记录所有dy_name vector m_vec_dy_pos;//记录dy_name在m_dy_config_info中对应的起始位置,对应m_vec_dy_names map > m_app_dys_map; // void gUsleep(const int usec); }; #endif