spi_decode_result.h 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // // ******************************************************************
  2. // // /\ /| @File spi_decode_result.h
  3. // // \ V/ @Brief
  4. // // | "") @Author lijinwen, ghz005@uni-trend.com.cn
  5. // // / | @Creation 2024-07-19
  6. // // / \\ @Modified 2024-07-23
  7. // // *(__\_\
  8. // // ******************************************************************
  9. #pragma once
  10. //#include <utility>
  11. //#include "protocol_spi_enums.h"
  12. #include "spi_packet.h"
  13. #include "../decode_result.h"
  14. //#include "spi_packet.h"
  15. //#include "../decode_event.h"
  16. namespace Protocol
  17. {
  18. class SpiDecodeResultCell : DecodeResultCell
  19. {
  20. };
  21. struct SpiDecodeResult //: DecodeResult
  22. {
  23. //bool decode_result_need_update = false;
  24. bool decode_event_need_update = false;
  25. //SpiDecodeResultCell* decode_result_cells_ptr; //解码数据结果指针
  26. SpiPacket* decode_events_ptr; //解码结果事件指针
  27. //uint64_t decode_result_count; //结果数量
  28. uint64_t decode_event_count; //事件数量
  29. intptr_t decoder_ptr;
  30. /* SpiDecodeResult() : decode_result_cells_ptr(nullptr), decode_events_ptr(nullptr), decode_result_count(0),
  31. decode_event_count(0) */
  32. SpiDecodeResult() : decode_event_need_update(false), decode_events_ptr(nullptr), decode_event_count(0), decoder_ptr(0)
  33. {
  34. }
  35. SpiDecodeResult(const SpiDecodeResult& result)
  36. {
  37. //decode_result_need_update = result.decode_result_need_update;
  38. decode_event_need_update = result.decode_event_need_update;
  39. //decode_result_cells_ptr = result.decode_result_cells_ptr;
  40. decode_events_ptr = result.decode_events_ptr;
  41. //decode_result_count = result.decode_result_count;
  42. decode_event_count = result.decode_event_count;
  43. decoder_ptr = result.decoder_ptr;
  44. }
  45. ~SpiDecodeResult() = default;
  46. /*SpiDecodeResult(SpiDecodeResult&& other) noexcept
  47. : decode_result_need_update(other.decode_result_need_update),
  48. decode_event_need_update(other.decode_event_need_update),
  49. decode_result_cells_ptr(other.decode_result_cells_ptr),
  50. decode_events_ptr(other.decode_events_ptr),
  51. decode_result_count(other.decode_result_count),
  52. decode_event_count(other.decode_event_count)*/
  53. SpiDecodeResult(SpiDecodeResult&& other) noexcept
  54. : decode_event_need_update(other.decode_event_need_update),
  55. decode_events_ptr(other.decode_events_ptr),
  56. decode_event_count(other.decode_event_count),
  57. decoder_ptr(0)
  58. {
  59. }
  60. SpiDecodeResult& operator=(const SpiDecodeResult& other)
  61. {
  62. if (this == &other) return *this;
  63. //decode_result_need_update = other.decode_result_need_update;
  64. decode_event_need_update = other.decode_event_need_update;
  65. //decode_result_cells_ptr = other.decode_result_cells_ptr;
  66. decode_events_ptr = other.decode_events_ptr;
  67. //decode_result_count = other.decode_result_count;
  68. decode_event_count = other.decode_event_count;
  69. decoder_ptr = other.decoder_ptr;
  70. return *this;
  71. }
  72. SpiDecodeResult& operator=(SpiDecodeResult&& other) noexcept
  73. {
  74. if (this == &other) return *this;
  75. //decode_result_need_update = other.decode_result_need_update;
  76. decode_event_need_update = other.decode_event_need_update;
  77. //decode_result_cells_ptr = other.decode_result_cells_ptr;
  78. decode_events_ptr = other.decode_events_ptr;
  79. //decode_result_count = other.decode_result_count;
  80. decode_event_count = other.decode_event_count;
  81. decoder_ptr = other.decoder_ptr;
  82. return *this;
  83. }
  84. };
  85. }