1 // 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 11 namespace common 12 { 13 /** 14 * @brief Frame source reader interface 15 * 16 * @tparam FrameDataT frame container data type 17 */ 18 template<typename FrameDataT> class IFrameReader 19 { 20 21 public: 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 45 }// namespace common