You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.1 KiB
C++

#ifndef LPALGORITHM_H
#define LPALGORITHM_H
#include "lpbengine.h"
class IAlgo
{
public:
IAlgo(){}
virtual ~IAlgo(){}
virtual bool RegisterFunc(IAlgorithmLib* pAlgoLib) { return true; };
virtual bool Exec(IDetectorTask *lpTask, IDetectorAlgorithm* lpAlgorithm) = 0;
virtual bool Init(IDetectorTask *lpTask, IDetectorAlgorithm* lpAlgorithm) = 0;
virtual void SaveUserParamValue(IDetectorTask *lpTask, IDetectorAlgorithm* lpAlgorithm, int nParamID) {};
virtual void LoadUserParamValue(IDetectorTask *lpTask, IDetectorAlgorithm* lpAlgorithm, int nParamID, QVariant& value) {};
};
#define REGISTER_FUNCTION_IMPLEMENT(NAME, FUNC, PARAMTYPELIST) \
if (NULL != pAlgoLib) { \
if (!pAlgoLib->RegisterFunc(#NAME, FUNC, PARAMTYPELIST)) \
return false; \
}
#ifdef ALGO_LIB
# define ALGO_EXPORT extern "C" __declspec(dllexport)
#else
# define ALGO_EXPORT extern "C" __declspec(dllimport)
#endif
typedef void(*FnLpAlgoNewInstance)(IAlgo** lppAlgo);
ALGO_EXPORT void LpAlgoNewInstance(IAlgo** lppAlgo);
ALGO_EXPORT bool LpAlgoDeleteInstance();
#endif // LPALGORITHM_H