eis/inc/zcache/CacheMag.h

78 lines
1.5 KiB
C++

/*********************************************************************
*
* 文 件: CacheMag.h //跟踪MAP信息
*
* 版权所有: Shanghai Baosight Software Co., Ltd.
*
* 概述://Handles message conversion and caching
*
* 版本历史
* 1.0 2009-04-01 zoufuzhou //TODO请添加本次主要修改内容
* %USER%
*********************************************************************/
#ifndef H_Cache_Mag_H
#define H_Cache_Mag_H
#include <log4cplus/LOG.h>
#include <Ice/BuiltinSequences.h>
#include <zlib/zoneDef.h>
#include <zlib/MemFix.hpp>
#include <glob/BinaryTele.h>
#include <map>
using namespace log4cplus;
using namespace std;
struct ADDR{
short mode;
char type;
short event;
short index;
short addr;
short addrbit;
short length;
short offset;
float factor;
};
class AD_MODE{
public:
static const short NORMAL = 0;
static const short UNKNOW = 1;
static const short BINARY = 2;
};
class CacheMag
{
public:
CacheMag(void);
public:
~CacheMag(void);
public:
int CacheTele(int eventNo, const ::Ice::ByteSeq& seq);
int ConvertTele(int eventNo, const ::Ice::ByteSeq& seq);
private:
/* Put the temporary cache messages in MapFix */
int PutTempTelInCache(void);
private:
BinaryTele* p_tele;
BinaryTele* p_btel;
/*map<teleId,vector<ADDR>>*/
std::map<int,std::vector<ADDR> > mv_tele;
private:
//map<eventNo,CMemFix<PLC_DATA>*> m_mapfix;
map<int,CMemFix<PLC_DATA>*> m_mapfix;
PLC_DATA* mp_temptel;
};
#endif