17 #ifndef ASTRA_FRAME_HPP
18 #define ASTRA_FRAME_HPP
21 #include "capi/astra_core.h"
34 Frame(astra_reader_frame_t readerFrame,
const bool autoCloseFrame)
35 : frameRef_(std::make_shared<FrameRef>(readerFrame, autoCloseFrame))
38 Frame(astra_reader_frame_t readerFrame)
39 :
Frame(readerFrame,
true)
45 return get<T>(DEFAULT_SUBTYPE);
49 T get(astra_stream_subtype_t subtype)
51 return T::template acquire<T>(frameRef_->get_frame(), subtype);
56 return frameRef_->get_frame() !=
nullptr;
68 FrameRef(astra_reader_frame_t readerFrame,
const bool autoCloseFrame)
69 : frame_(readerFrame),
70 autoCloseFrame_(autoCloseFrame)
75 if (frame_ !=
nullptr && autoCloseFrame_)
77 astra_reader_close_frame(&frame_);
81 astra_reader_frame_t get_frame()
const {
return frame_; }
84 astra_reader_frame_t frame_;
85 const bool autoCloseFrame_;
88 std::shared_ptr<FrameRef> frameRef_;
Frame class
Definition: Frame.hpp:32