| | |
| | | //}; |
| | | |
| | | static bool t_live_ret = true; |
| | | |
| | | //全局的信号量,如果数据刷新延迟过高可以改为使用nsq消息队列。 |
| | | static pthread_cond_t func_cond(PTHREAD_COND_INITIALIZER); |
| | | static pthread_mutex_t func_cond_mutex(PTHREAD_MUTEX_INITIALIZER); |
| | | |
| | |
| | | virtual ~FaceFeatureSearchServerI(); |
| | | |
| | | public: |
| | | /** |
| | | * @deprecated |
| | | * @return |
| | | */ |
| | | virtual ::FaceSearch::FaceResults faceSearchMax(const ::FaceSearch::Data &, const ::std::string &, |
| | | const ::Ice::Current & = ::Ice::emptyCurrent); |
| | | |
| | | /*** |
| | | * 对比获取第n大的人员 |
| | | * @return |
| | | */ |
| | | virtual ::FaceSearch::FaceResults |
| | | faceSearchTopN(const ::FaceSearch::Data &, const ::std::string &, ::Ice::Int, ::Ice::Float, |
| | | const ::Ice::Current & = ::Ice::emptyCurrent); |
| | | |
| | | private: |
| | | /** |
| | | * @deprecated |
| | | * @param nodeName |
| | | * @param cookie |
| | | * @return |
| | | */ |
| | | bool initErlang(std::string nodeName, std::string cookie); |
| | | |
| | | //#todo delete cache |
| | | |
| | | //#todo loadData |
| | | /** |
| | | * 加载人脸属性 |
| | | * @param faceFea |
| | | * @return |
| | | */ |
| | | static bool loadFeatureData(FaceFeatureSearchServerI *faceFea); |
| | | |
| | | /** |
| | | * 数据更新线程,有信号触发才会更新 |
| | | * @param faceFea |
| | | */ |
| | | static void dataUpdate(FaceFeatureSearchServerI *faceFea); |
| | | |
| | | /*** |
| | | * 等待底库表加载成功 |
| | | * @param faceFea |
| | | * @param loop |
| | | */ |
| | | static void waitTables(FaceFeatureSearchServerI *faceFea, int loop = -1); |
| | | |
| | | // void erlangCallBackFunc(std::string); |
| | | |
| | | private: |
| | | long m_inTime; |
| | | // 特征对比类 |
| | | std::map<std::string, FaceDBCompareServer *> m_faceFCMAP; |
| | | // 底库类型,生效时间等 |
| | | std::map<std::string, TableInfo> m_tableType; |
| | | |
| | | // 对 m_faceFCMAP 加读写锁 |
| | | // 当对比时,数据刷新会等待 |
| | | RWLock m_rwLock; |
| | | |
| | | ErlangTool::ErlangDbTool m_erlangDbTool; |
| | | |
| | | SqliteFaceEncap m_sqliteFaceEncap; |
| | | |
| | | std::mutex m_mutex; |
| | | bool m_retUpdatePthread; |
| | | |
| | | Base64 base64; |
| | | // Ice::ObjectPrx base_FaceMemoryData; |
| | | // IceRpcClient<::FaceSearch::FaceMemoryDataPrx> m_faceMemoryClient; |
| | | // ::FaceSearch::FaceMemoryDataPrx serverFaceMemoryData; |
| | | |
| | | // func_cond_mutex(PTHREAD_MUTEX_INITIALIZER), func_cond(PTHREAD_COND_INITIALIZER) |
| | | |
| | | EsDBTool pManagerEsDB;//(appPref.getStringData("ipAdd"), appPref.getIntData("ipPort")); |
| | | }; |