iic_decode_result.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // // ******************************************************************
  2. // // /\ /| @File iic_decode_result.h
  3. // // \ V/ @Brief
  4. // // | "") @Author lijinwen, ghz005@uni-trend.com.cn
  5. // // / | @Creation 2024-07-19
  6. // // / \\ @Modified 2024-07-25
  7. // // *(__\_\
  8. // // ******************************************************************
  9. #pragma once
  10. //#include <utility>
  11. //#include "protocol_iic_enums.h"
  12. //#include "iic_decode_event.h"
  13. #include "iic_packet.h"
  14. #include "../decode_result.h"
  15. //#include "iic_packet.h"
  16. //#include "../decode_event.h"
  17. namespace Protocol
  18. {
  19. class IicDecodeResultCell : DecodeResultCell
  20. {
  21. };
  22. struct IicDecodeResult //: DecodeResult
  23. {
  24. bool decode_event_need_update = false;
  25. uint64_t decode_event_count; //事件数量
  26. IicEvent* decode_events_ptr; //解码结事件指针
  27. IicDataInfo* decode_data_cell_ptr; //解码结果数据指针
  28. intptr_t decoder_ptr;
  29. IicDecodeResult() : decode_event_count(0),
  30. decode_events_ptr(nullptr),
  31. decoder_ptr(0)
  32. {
  33. }
  34. IicDecodeResult(const IicDecodeResult& result)
  35. {
  36. decode_event_need_update = result.decode_event_need_update;
  37. decode_events_ptr = result.decode_events_ptr;
  38. decoder_ptr = 0;
  39. decode_event_count = result.decode_event_count;
  40. }
  41. ~IicDecodeResult() = default;
  42. IicDecodeResult(IicDecodeResult&& other) noexcept
  43. : decode_event_need_update(other.decode_event_need_update),
  44. decode_event_count(other.decode_event_count),
  45. decode_events_ptr(other.decode_events_ptr),
  46. decoder_ptr(other.decoder_ptr)
  47. {
  48. }
  49. IicDecodeResult& operator=(const IicDecodeResult& other)
  50. {
  51. if (this == &other) return *this;
  52. decode_event_need_update = other.decode_event_need_update;
  53. decode_events_ptr = other.decode_events_ptr;
  54. decode_event_count = other.decode_event_count;
  55. return *this;
  56. }
  57. IicDecodeResult& operator=(IicDecodeResult&& other) noexcept
  58. {
  59. if (this == &other) return *this;
  60. decode_event_need_update = other.decode_event_need_update;
  61. decode_events_ptr = other.decode_events_ptr;
  62. decode_event_count = other.decode_event_count;
  63. return *this;
  64. }
  65. };
  66. }