12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- // // ******************************************************************
- // // /\ /| @File Usb_decode_result.h
- // // \ V/ @Brief
- // // | "") @Author lijinwen, ghz005@uni-trend.com.cn
- // // / | @Creation 2024-05-17
- // // / \\ @Modified 2024-06-24
- // // *(__\_\
- // // ******************************************************************
- #pragma once
- //#include <utility>
- //#include "protocol_Usb_enums.h"
- #include "Usb_decode_event.h"
- #include "../decode_result.h"
- //#include "Usb_packet.h"
- //#include "../decode_event.h"
- namespace Protocol
- {
- class UsbDecodeResultCell : DecodeResultCell
- {
- };
- struct UsbDecodeResult //: DecodeResult
- {
- bool decode_result_need_update = false;
- bool decode_event_need_update = false;
- UsbDecodeResultCell* decode_result_cells_ptr; //解码数据结果指针
- UsbDecodeEvent* decode_events_ptr; //解码结果事件指针
- uint64_t decode_result_count; //结果数量
- uint64_t decode_event_count; //事件数量
- UsbEnums::UsbSpeed usb_speed; //真实速率
- intptr_t usb_decoder_ptr;
- //std::vector<UsbDecoderesultCell> DecodeResultCells;
- //std::vector<UsbDecodeEvent> DecodeEventCells;
- UsbDecodeResult() : decode_result_cells_ptr(nullptr), decode_events_ptr(nullptr), decode_result_count(0),
- decode_event_count(0),
- usb_speed(UsbEnums::UsbSpeed::FULL_SPEED), usb_decoder_ptr(0)
- {
- //ProtocolType = SerialProtocolType::Usb;
- //DecodeResultCells = {};
- }
- UsbDecodeResult(const UsbDecodeResult& result) : usb_speed(UsbEnums::UsbSpeed::FULL_SPEED), usb_decoder_ptr(0)
- {
- decode_result_need_update = result.decode_result_need_update;
- decode_event_need_update = result.decode_event_need_update;
- decode_result_cells_ptr = result.decode_result_cells_ptr;
- decode_events_ptr = result.decode_events_ptr;
- decode_result_count = result.decode_result_count;
- decode_event_count = result.decode_event_count;
- }
- ~UsbDecodeResult() = default;
- UsbDecodeResult(UsbDecodeResult&& other) noexcept
- : decode_result_need_update(other.decode_result_need_update),
- decode_event_need_update(other.decode_event_need_update),
- decode_result_cells_ptr(other.decode_result_cells_ptr),
- decode_events_ptr(other.decode_events_ptr),
- decode_result_count(other.decode_result_count),
- decode_event_count(other.decode_event_count), usb_speed(UsbEnums::UsbSpeed::FULL_SPEED), usb_decoder_ptr(0)
- {
- }
- UsbDecodeResult& operator=(const UsbDecodeResult& other)
- {
- if (this == &other) return *this;
- decode_result_need_update = other.decode_result_need_update;
- decode_event_need_update = other.decode_event_need_update;
- decode_result_cells_ptr = other.decode_result_cells_ptr;
- decode_events_ptr = other.decode_events_ptr;
- decode_result_count = other.decode_result_count;
- decode_event_count = other.decode_event_count;
- return *this;
- }
- UsbDecodeResult& operator=(UsbDecodeResult&& other) noexcept
- {
- if (this == &other) return *this;
- decode_result_need_update = other.decode_result_need_update;
- decode_event_need_update = other.decode_event_need_update;
- decode_result_cells_ptr = other.decode_result_cells_ptr;
- decode_events_ptr = other.decode_events_ptr;
- decode_result_count = other.decode_result_count;
- decode_event_count = other.decode_event_count;
- return *this;
- }
- //void Add(const UsbDecoderesultCell* cell);
- };
- }
|