blob: 79e228f94fad67b0eccb35cede3551e065aa5047 [file] [log] [blame]
Patrick Venture33bf1692018-11-06 20:19:17 -08001#pragma once
2
Patrick Venture1cde5f92018-11-07 08:26:47 -08003#include <cstdint>
4#include <vector>
5
Patrick Venture33bf1692018-11-06 20:19:17 -08006namespace blobs
7{
8
9/**
10 * Each data transport mechanism must implement the DataInterface.
11 */
12class DataInterface
13{
14 public:
15 virtual ~DataInterface() = default;
Patrick Venture1cde5f92018-11-07 08:26:47 -080016
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
26struct DataHandlerPack
27{
28 std::uint16_t bitmask;
29 DataInterface* handler;
Patrick Venture33bf1692018-11-06 20:19:17 -080030};
31
32} // namespace blobs