123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- // // ******************************************************************
- // // /\ /| @File ProtocolFactory.h
- // // \ V/ @Brief
- // // | "") @Author lijinwen, ghz005@uni-trend.com.cn
- // // / | @Creation 2024-5-6
- // // / \\ @Modified 2024-5-13
- // // *(__\_\
- // // ******************************************************************
- #pragma once
- #include <memory>
- #include "ProtocolDecodeBase.h"
- #define DLL_VERSION "0.1.1"
- #ifdef LIBMATH_EXPORTS
- #define LIBMATH_API __declspec(dllexport)
- #else
- #define LIBMATH_API __declspec(dllimport)
- #endif
- namespace Protocol
- {
- static std::unique_ptr<ProtocolDecodeBase> glDecoderPtr;
- class LIBMATH_API ProtocolFactory
- {
- public:
- static bool CreateProtocol(SerialProtocolType protocolType);
- //获取解码库内部版本
- static void GetVersion(uint8_t* version);
- static ProtocolDecodeBase* GetDecoderPtrExport();
- static void ReleaseDecoder()
- {
- if (glDecoderPtr)
- {
- // 释放对象
- glDecoderPtr.reset();
- }
- }
- private:
- };
- extern "C" {
- LIBMATH_API ProtocolDecodeBase* CreateProtocolExport(SerialProtocolType protocolType, LogLevel level);
- LIBMATH_API void GetVersionExport(uint8_t* version);
- LIBMATH_API void ReleaseExport();
- }
- }
|