#include "FingerPrintDev.h" #include "log4vendor.h" FingerPrintImpl* g_pFingerDev = NULL; void __attribute__((destructor)) uninit() { if (g_pFingerDev) { delete g_pFingerDev; g_pFingerDev = NULL; } } void __attribute__((constructor)) init() { } ErrorCodeEnum CreateDevComponent(DeviceBaseClass *&baseObj) { ErrorCodeEnum eRt = Error_Succeed; if(NULL == g_pFingerDev) { g_pFingerDev = new FingerPrintImpl(); baseObj = (DeviceBaseClass *)g_pFingerDev; cmb::log_init_config config; config.log_level=CMB_LOG_LEVEL_ALL; config.dev_name = "Finger"; #if defined(_MSC_VER) config.log_dir = ("C:\\rvc\\dbg\\"); #else config.log_dir = ("/opt/rvc/dbg/"); #endif //_MSC_VER std::string str; cmb::log4vendor::init(config, str); printf("init after: %s\n", str.c_str()); } else { eRt = Error_AlreadyExist; } return eRt; } ErrorCodeEnum ReleaseDevComponent(DeviceBaseClass *&pBaseObj) { ErrorCodeEnum eRt = Error_Succeed; if(pBaseObj == (DeviceBaseClass*)g_pFingerDev) { delete g_pFingerDev; g_pFingerDev = NULL; return Error_Succeed; } return Error_Param; }