IErrorCode.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef __I_ERRORCODE_H__
  2. #define __I_ERRORCODE_H__
  3. // *****************************************************************************
  4. // 版权所有(C)2023~2099 上海骄成超声波技术有限公司
  5. // 保留所有权利
  6. // *****************************************************************************
  7. // 作者 : 陆蕴凡
  8. // 版本 : 1.0
  9. // 代码创建日期:2025/01/09
  10. // 版本更新日期:2025/01/09
  11. // 功能说明:查找错误码信息接口
  12. // *****************************************************************************
  13. #include <vector>
  14. #include <string>
  15. #include "TypeDef.h"
  16. namespace JVision
  17. {
  18. /**
  19. * @brief 查找错误码信息的接口基类
  20. *
  21. */
  22. class JVision_API IErrorCode
  23. {
  24. public:
  25. virtual ~IErrorCode() = 0 {}
  26. /**
  27. * @brief 获取错误码对应的错误原因
  28. * @param[in] code 错误码
  29. *
  30. * @return std::string 错误原因,中文字符
  31. */
  32. virtual std::string ResultStr(JVision::ResultCode code) = 0;
  33. /**
  34. * @brief 获取错误码接口的实现类指针
  35. */
  36. static IErrorCode* GetErrorCode();
  37. /**
  38. * 使用案例:
  39. *
  40. * JVision::ExecuteErrorCode* errorPtr = JVision::IErrorCode::GetErrorCode();
  41. *std::string errorMsg = errorPtr->ResultStr(result);
  42. */
  43. };
  44. }
  45. #endif