v2.0.0
Loading...
Searching...
No Matches
lsl_stream_inlet.h
Go to the documentation of this file.
1//=============================================================================================================
32
33#ifndef LSL_STREAM_INLET_H
34#define LSL_STREAM_INLET_H
35
36//=============================================================================================================
37// INCLUDES
38//=============================================================================================================
39
40#include "lsl_global.h"
41#include "lsl_stream_info.h"
42
43//=============================================================================================================
44// STL INCLUDES
45//=============================================================================================================
46
47#include <vector>
48#include <memory>
49#include <type_traits>
50
51//=============================================================================================================
52// DEFINE NAMESPACE LSLLIB
53//=============================================================================================================
54
55namespace LSLLIB
56{
57
58//=============================================================================================================
59// FORWARD DECLARATIONS
60//=============================================================================================================
61
66
67//=============================================================================================================
76{
77public:
78 //=========================================================================================================
84 explicit stream_inlet(const stream_info& info);
85
86 //=========================================================================================================
91
92 //=========================================================================================================
98 void open_stream();
99
100 //=========================================================================================================
104 void close_stream();
105
106 //=========================================================================================================
114 [[nodiscard]] bool samples_available();
115
116 //=========================================================================================================
126 template<typename T>
127 [[nodiscard]] std::vector<std::vector<T>> pull_chunk()
128 {
129 static_assert(std::is_same_v<T, float>,
130 "lsl::stream_inlet::pull_chunk<T>: only float is supported");
131 return pull_chunk_float();
132 }
133
134 //=========================================================================================================
140 [[nodiscard]] std::vector<std::vector<float>> pull_chunk_float();
141
142private:
144 std::unique_ptr<StreamInletPrivate> m_pImpl;
145};
146
147} // namespace LSLLIB
148
149#endif // LSL_STREAM_INLET_H
Declares stream_info, the LSL metadata descriptor that identifies and routes a stream on the network.
LSLLIB shared-library export macro and build-stamp accessors used by every public LSL symbol.
#define LSLSHARED_EXPORT
Definition lsl_global.h:51
Lab Streaming Layer (LSL) integration for real-time data exchange.
Value-type descriptor of a single LSL stream: semantic metadata plus transport endpoint,...
stream_inlet(const stream_info &info)
std::vector< std::vector< float > > pull_chunk_float()
std::vector< std::vector< T > > pull_chunk()