/********************************************************************* * * 文 件: AlgorithmManager.h * * 版权所有: Shanghai Baosight Software Co., Ltd. * * *********************************************************************/ #ifndef H_ALGORITHM_MANAGER_H #define H_ALGORITHM_MANAGER_H #include #include #include #include #include #include #include #include using namespace std; using namespace baosight; #define EVENT_NO_MAX 2011 #define EVENT_NO_MIN 2000 class EV_CASE { public: static const int CTRL_DELETE = 0; static const int CTRL_CREATE = 1; static const int CTRL_UPDATE = 2; static const int CTRL_ENABLE = 3; }; // Algorithm thread heandle struct ALG_HANDLE { bool active; IceUtil::Handle tHDL; IceUtil::ThreadControl tTC; }; /********************************************************************* * 类 名: AlgorithmManager * 版权所有: Shanghai Baosight Software Co., Ltd. * *********************************************************************/ class AlgorithmManager { public: AlgorithmManager(); virtual ~AlgorithmManager(); public: virtual void Dispose(int eventno, const ::Ice::ByteSeq &); int Attach(const string ruleid, short algid, const string &name, const Json::Value &rulejson, bool usable = true); int Detach(const string &ruleid, short algid); int Detach(short algid); int SetUsable(const string &ruleid, short algid); void CacheData(void); protected: BinaryTele *p_tele; private: CMemTable *mp_tcfg; // map m_mapalg; map m_mapalg; map m_mapRalg; AlgorithmBuilder m_algbuilder; }; #endif