v2.0.0
Loading...
Searching...
No Matches
stream_inlet.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef LSL_STREAM_INLET_H
36#define LSL_STREAM_INLET_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
42#include "lsl_global.h"
43#include "stream_info.h"
44
45//=============================================================================================================
46// STL INCLUDES
47//=============================================================================================================
48
49#include <vector>
50#include <memory>
51#include <type_traits>
52
53//=============================================================================================================
54// DEFINE NAMESPACE lsl
55//=============================================================================================================
56
57namespace LSLLIB {
58
59//=============================================================================================================
60// FORWARD DECLARATIONS
61//=============================================================================================================
62
67
68//=============================================================================================================
78{
79public:
80 //=========================================================================================================
86 explicit stream_inlet(const stream_info& info);
87
88 //=========================================================================================================
93
94 //=========================================================================================================
100 void open_stream();
101
102 //=========================================================================================================
106 void close_stream();
107
108 //=========================================================================================================
116 bool samples_available();
117
118 //=========================================================================================================
128 template<typename T>
129 std::vector<std::vector<T>> pull_chunk()
130 {
131 static_assert(std::is_same<T, float>::value,
132 "lsl::stream_inlet::pull_chunk<T>: only float is supported");
133 return pull_chunk_float();
134 }
135
136 //=========================================================================================================
142 std::vector<std::vector<float>> pull_chunk_float();
143
144private:
146 std::unique_ptr<StreamInletPrivate> m_pImpl;
147};
148
149} // namespace LSLLIB
150
151#endif // LSL_STREAM_INLET_H
Contains the declaration of the stream_info class.
lsl library export/import macros.
#define LSLSHARED_EXPORT
Definition lsl_global.h:55
Lab Streaming Layer (LSL) integration for real-time data exchange.
Describes a particular stream on the network.
Definition stream_info.h:82
stream_inlet(const stream_info &info)
std::vector< std::vector< float > > pull_chunk_float()
std::vector< std::vector< T > > pull_chunk()