Simulated Reality SDK 7500c78d v1.30.2.51085 2024-04-26T11:23:03Z
Stable
inputstream.h
Go to the documentation of this file.
1
10#pragma once
11#include <memory>
12
13namespace SR {
14
24template<typename StreamType>
31#pragma warning(suppress: 4251)
32 std::shared_ptr<StreamType> stream = nullptr;
33
34public:
39 if (stream != nullptr) {
40 stream->stopListening();
41 }
42 }
43
53 void set(std::shared_ptr<StreamType> input) {
54 if (stream != nullptr) {
55 stream->stopListening();
56 }
57 stream = input;
58 }
59};
60
61}
Template class to wrap data stream to a listener object.
Definition: inputstream.h:25
~InputStream()
Cleans up the associated StreamType stream.
Definition: inputstream.h:38
void set(std::shared_ptr< StreamType > input)
Must be set to allow proper cleanup of internal stream.
Definition: inputstream.h:53
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:25