eis/inc/zsbrk/StripBreak.h

87 lines
2.0 KiB
C
Raw Permalink Normal View History

/*********************************************************************
*
* <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>: MapCollect.h //<2F><><EFBFBD><EFBFBD>MAP<41><50>Ϣ
*
* <EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Shanghai Baosight Software Co., Ltd.
*
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>//<2F><><EFBFBD><EFBFBD>MAP<41><50>Ϣ<EFBFBD>ɼ<EFBFBD>
*
* <EFBFBD><EFBFBD><EFBFBD>ʷ
* 1.0 2009-04-01 zoufuzhou //TODO<44><4F><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD><D3B1><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>޸<EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>
* %USER%
*********************************************************************/
#ifndef H_STRIP_BREAK_H
#define H_STRIP_BREAK_H
#include <log4cplus/LOG.h>
#include <Ice/BuiltinSequences.h>
#include <zlib/zoneDef.h>
#include <zlib/MemTable.hpp>
#include <zlib/MemFix.hpp>
#include <glob/BinaryTele.h>
#include <json/json.h>
#include <map>
using namespace log4cplus;
using namespace std;
const int CS_BRK_ZONE= 45;
const int CS_BRK_SIZE= 7;//<<3C>ϴ<EFBFBD><CFB4>źŸ<C5BA><C5B8><EFBFBD> <20><><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ǰ<EFBFBD><C7B0>
const int CS_WAIT_TIME= 5*1000; //ms
const int CS_SBRK_SIGN_LEN=186;//<2F>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD>
const int CS_CACHE_SIZE=9000;//<2F>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD>
struct SBRK_SIGN{
float sbreak[CS_BRK_SIZE];
// float tension;
// float think_dev;
float spare[CS_SBRK_SIGN_LEN-CS_BRK_SIZE];
};
class StripBreak
{
public:
StripBreak(const string& rootdir);
public:
~StripBreak(void);
public:
int CacheTele(int eventNo, const ::Ice::ByteSeq& seq);
int Dispose(int eventNo, const ::Ice::ByteSeq& seq);
private:
int IsBreak(void);
int Archive(int break_index);
private:
void organize(int, Json::Value&);
short Proxy(int eventNo,const string& proxyName, const char* str,int length);
int save(const std::string& file,const string& strdata);
int getFiles(const std::string& path,std::vector<string> &files);
std::string getPath(const string& path = "");
bool fileCompress(string file,string cfile);
bool fileDeCompress(string file,string cfile);
private:
BinaryTele* p_tele;
CMemTable<SBRK_SIGN>* mp_table;
SBRK_SIGN* mp_newsign;
SBRK_SIGN* mp_oldsign;
CMemFix<SBRK_SIGN>* mp_cache;
private:
string m_rootdir;
Json::Reader m_reader;
Json::FastWriter m_writer;
Json::Value::Members::iterator m_it;
private:
int m_sbrkindex;
};
#endif