Patrick Venture | 33bf169 | 2018-11-06 20:19:17 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 3 | #include <cstdint> |
| 4 | #include <vector> |
| 5 | |
Patrick Venture | 33bf169 | 2018-11-06 20:19:17 -0800 | [diff] [blame] | 6 | namespace blobs |
| 7 | { |
| 8 | |
| 9 | /** |
| 10 | * Each data transport mechanism must implement the DataInterface. |
| 11 | */ |
| 12 | class DataInterface |
| 13 | { |
| 14 | public: |
| 15 | virtual ~DataInterface() = default; |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 16 | |
| 17 | /** |
| 18 | * Copy bytes from external interface (blocking call). |
| 19 | * |
| 20 | * @param[in] length - number of bytes to copy |
| 21 | * @return the bytes read |
| 22 | */ |
| 23 | virtual std::vector<std::uint8_t> copyFrom(std::uint32_t length) = 0; |
| 24 | }; |
| 25 | |
| 26 | struct DataHandlerPack |
| 27 | { |
| 28 | std::uint16_t bitmask; |
| 29 | DataInterface* handler; |
Patrick Venture | 33bf169 | 2018-11-06 20:19:17 -0800 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | } // namespace blobs |