v2.0.0
Loading...
Searching...
No Matches
stream_info.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef LSL_STREAM_INFO_H
36#define LSL_STREAM_INFO_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
42#include "lsl_global.h"
43
44//=============================================================================================================
45// STL INCLUDES
46//=============================================================================================================
47
48#include <string>
49
50//=============================================================================================================
51// DEFINE NAMESPACE lsl
52//=============================================================================================================
53
54namespace LSLLIB {
55
56//=============================================================================================================
70
71//=============================================================================================================
82{
83public:
84 //=========================================================================================================
89
90 //=========================================================================================================
101 stream_info(const std::string& name,
102 const std::string& type,
103 int channel_count = 0,
104 double nominal_srate = 0.0,
106 const std::string& source_id = "");
107
108 //=========================================================================================================
112 stream_info(const stream_info& other) = default;
113
114 //=========================================================================================================
118 stream_info& operator=(const stream_info& other) = default;
119
120 //=========================================================================================================
123
125 std::string name() const;
126
128 std::string type() const;
129
131 int channel_count() const;
132
134 double nominal_srate() const;
135
138
140 std::string source_id() const;
141
143
144 //=========================================================================================================
147
149 std::string uid() const;
150
152 std::string hostname() const;
153
155
156 //=========================================================================================================
159
161 int data_port() const;
162
164 std::string data_host() const;
165
167 void set_data_port(int port);
168
170 void set_data_host(const std::string& host);
171
173
174 //=========================================================================================================
177
179 std::string to_string() const;
180
182 static stream_info from_string(const std::string& data);
183
185
186private:
187 std::string m_name;
188 std::string m_type;
189 int m_channel_count;
190 double m_nominal_srate;
191 channel_format_t m_channel_format;
192 std::string m_source_id;
193 std::string m_uid;
194 std::string m_hostname;
195
196 int m_data_port;
197 std::string m_data_host;
198};
199
200} // namespace LSLLIB
201
202#endif // LSL_STREAM_INFO_H
lsl library export/import macros.
#define LSLSHARED_EXPORT
Definition lsl_global.h:55
Lab Streaming Layer (LSL) integration for real-time data exchange.
channel_format_t
Definition stream_info.h:60
@ cf_double64
Definition stream_info.h:63
@ cf_string
Definition stream_info.h:64
@ cf_undefined
Definition stream_info.h:61
@ cf_float32
Definition stream_info.h:62
stream_info & operator=(const stream_info &other)=default
std::string to_string() const
Serialize stream_info into a string for network transport.
stream_info(const stream_info &other)=default
std::string type() const
Content type of the stream.
std::string hostname() const
Hostname of the machine from which the stream originates.
void set_data_host(const std::string &host)
Set the data host (used internally during discovery).
int channel_count() const
Number of channels.
double nominal_srate() const
Nominal sampling rate in Hz. 0.0 means irregular.
void set_data_port(int port)
Set the TCP data port (used internally during discovery / outlet creation).
std::string name() const
Name of the stream.
std::string data_host() const
Host address of the outlet (IP, set from UDP sender address during discovery).
std::string uid() const
A unique identifier for this particular stream instance (auto-generated).
std::string source_id() const
Unique source identifier.
channel_format_t channel_format() const
Data format of a channel.
static stream_info from_string(const std::string &data)
Deserialize a stream_info from a network transport string.
int data_port() const
TCP data port of the outlet.