blob: e171b3bb942a3e1da50333680a3a521dd31252f6 [file] [log] [blame]
Éanna Ó Catháin919c14e2020-09-14 17:36:49 +01001//
2// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
8#include <cstddef>
9#include <memory>
10
Éanna Ó Catháinc6ab02a2021-04-07 14:35:25 +010011namespace common
Éanna Ó Catháin919c14e2020-09-14 17:36:49 +010012{
13/**
14 * @brief Frame source reader interface
15 *
16 * @tparam FrameDataT frame container data type
17 */
18template<typename FrameDataT> class IFrameReader
19{
20
21public:
22 /**
23 * @brief Reads the next frame from the source
24 *
25 * @return pointer to the frame container
26 */
27 virtual std::shared_ptr <FrameDataT> ReadFrame() = 0;
28
29 /**
30 * @brief Checks if the frame source has more frames to read.
31 *
32 * @param[in] frame the pointer to the last frame captured with the ReadFrame method could be used in
33 * implementation specific logic to check frames source state.
34 * @return True if frame source was exhausted, False otherwise
35 */
36 virtual bool IsExhausted(const std::shared_ptr <FrameDataT>& frame) const = 0;
37
38 /**
39 * @brief Default destructor
40 */
41 virtual ~IFrameReader() = default;
42
43};
44
Éanna Ó Catháinc6ab02a2021-04-07 14:35:25 +010045}// namespace common