LeiaSR SDK 720218b2 v1.32.7.6322 2025-02-13T14:55:38Z
Stable
inputstream.h
Go to the documentation of this file.
1
5#pragma once
6#include <memory>
7
8namespace SR {
9
19template<typename StreamType>
26#pragma warning(suppress: 4251)
27 std::shared_ptr<StreamType> stream = nullptr;
28
29public:
34 if (stream != nullptr) {
35 stream->stopListening();
36 }
37 }
38
48 void set(std::shared_ptr<StreamType> input) {
49 if (stream != nullptr) {
50 stream->stopListening();
51 }
52 stream = input;
53 }
54};
55
56}
Template class to wrap data stream to a listener object.
Definition: inputstream.h:20
~InputStream()
Cleans up the associated StreamType stream.
Definition: inputstream.h:33
void set(std::shared_ptr< StreamType > input)
Must be set to allow proper cleanup of internal stream.
Definition: inputstream.h:48
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:20