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// FORWARD DECLARATIONS
59//=============================================================================================================
60
65
66//=============================================================================================================
71{
72public:
73 //=========================================================================================================
79 explicit stream_inlet(const stream_info& info);
80
81 //=========================================================================================================
86
87 //=========================================================================================================
93 void open_stream();
94
95 //=========================================================================================================
99 void close_stream();
100
101 //=========================================================================================================
109 [[nodiscard]] bool samples_available();
110
111 //=========================================================================================================
121 template<typename T>
122 [[nodiscard]] std::vector<std::vector<T>> pull_chunk()
123 {
124 static_assert(std::is_same_v<T, float>,
125 "lsl::stream_inlet::pull_chunk<T>: only float is supported");
126 return pull_chunk_float();
127 }
128
129 //=========================================================================================================
135 [[nodiscard]] std::vector<std::vector<float>> pull_chunk_float();
136
137private:
139 std::unique_ptr<StreamInletPrivate> m_pImpl;
140};
141
142} // namespace LSLLIB
143
144#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()