Class lsl::stream_outlet
ClassList > lsl > stream_outlet
#include <lsl_cpp.h>
Public Functions
| Type | Name |
|---|---|
| std::shared_ptr< lsl_outlet_struct_ > | handle () |
| bool | have_consumers () |
| stream_info | info () const |
| stream_outlet & | operator= (stream_outlet && rhs) noexcept |
| void | push_chunk (const std::vector< T > & samples, double timestamp=0.0, bool pushthrough=true) |
| void | push_chunk (const std::vector< T > & samples, const std::vector< double > & timestamps, bool pushthrough=true) |
| void | push_chunk_multiplexed (const std::vector< T > & buffer, double timestamp=0.0, bool pushthrough=true) |
| void | push_chunk_multiplexed (const std::vector< T > & buffer, const std::vector< double > & timestamps, bool pushthrough=true) |
| void | push_chunk_multiplexed (const float * buffer, std::size_t buffer_elements, double timestamp=0.0, bool pushthrough=true) |
| void | push_chunk_multiplexed (const double * buffer, std::size_t buffer_elements, double timestamp=0.0, bool pushthrough=true) |
| void | push_chunk_multiplexed (const int64_t * buffer, std::size_t buffer_elements, double timestamp=0.0, bool pushthrough=true) |
| void | push_chunk_multiplexed (const int32_t * buffer, std::size_t buffer_elements, double timestamp=0.0, bool pushthrough=true) |
| void | push_chunk_multiplexed (const int16_t * buffer, std::size_t buffer_elements, double timestamp=0.0, bool pushthrough=true) |
| void | push_chunk_multiplexed (const char * buffer, std::size_t buffer_elements, double timestamp=0.0, bool pushthrough=true) |
| void | push_chunk_multiplexed (const std::string * buffer, std::size_t buffer_elements, double timestamp=0.0, bool pushthrough=true) |
| void | push_chunk_multiplexed (const float * data_buffer, const double * timestamp_buffer, std::size_t data_buffer_elements, bool pushthrough=true) |
| void | push_chunk_multiplexed (const double * data_buffer, const double * timestamp_buffer, std::size_t data_buffer_elements, bool pushthrough=true) |
| void | push_chunk_multiplexed (const int64_t * data_buffer, const double * timestamp_buffer, std::size_t data_buffer_elements, bool pushthrough=true) |
| void | push_chunk_multiplexed (const int32_t * data_buffer, const double * timestamp_buffer, std::size_t data_buffer_elements, bool pushthrough=true) |
| void | push_chunk_multiplexed (const int16_t * data_buffer, const double * timestamp_buffer, std::size_t data_buffer_elements, bool pushthrough=true) |
| void | push_chunk_multiplexed (const char * data_buffer, const double * timestamp_buffer, std::size_t data_buffer_elements, bool pushthrough=true) |
| void | push_chunk_multiplexed (const std::string * data_buffer, const double * timestamp_buffer, std::size_t data_buffer_elements, bool pushthrough=true) |
| void | push_chunk_numeric_structs (const std::vector< T > & samples, double timestamp=0.0, bool pushthrough=true) |
| void | push_chunk_numeric_structs (const std::vector< T > & samples, const std::vector< double > & timestamps, bool pushthrough=true) |
| void | push_numeric_raw (const void * sample, double timestamp=0.0, bool pushthrough=true) |
| void | push_numeric_struct (const T & sample, double timestamp=0.0, bool pushthrough=true) |
| void | push_sample (const T data, double timestamp=0.0, bool pushthrough=true) |
| void | push_sample (const std::vector< T > & data, double timestamp=0.0, bool pushthrough=true) |
| void | push_sample (const float * data, double timestamp=0.0, bool pushthrough=true) |
| void | push_sample (const double * data, double timestamp=0.0, bool pushthrough=true) |
| void | push_sample (const int64_t * data, double timestamp=0.0, bool pushthrough=true) |
| void | push_sample (const int32_t * data, double timestamp=0.0, bool pushthrough=true) |
| void | push_sample (const int16_t * data, double timestamp=0.0, bool pushthrough=true) |
| void | push_sample (const char * data, double timestamp=0.0, bool pushthrough=true) |
| void | push_sample (const std::string * data, double timestamp=0.0, bool pushthrough=true) |
| stream_outlet (stream_outlet && res) noexcept stream_outlet move constructor |
|
| stream_outlet (const stream_info & info, int32_t chunk_size=0, int32_t max_buffered=360, lsl_transport_options_t flags=transp_default) |
|
| bool | wait_for_consumers (double timeout) |
| ~stream_outlet () = default |
Detailed Description
A stream outlet. Outlets are used to make streaming data (and the meta-data) available on the lab network.
Public Functions Documentation
function handle
Return a shared pointer to pass to C-API functions that aren't wrapped yet
Example:
function have_consumers
Check whether consumers are currently registered. While it does not hurt, there is technically no reason to push samples if there is no consumer.
function info
Retrieve the stream info provided by this outlet. This is what was used to create the stream (and also has the Additional Network Information fields assigned).
function operator=
function push_chunk [1/2]
template<class T>
inline void lsl::stream_outlet::push_chunk (
const std::vector< T > & samples,
double timestamp=0.0,
bool pushthrough=true
)
Push a chunk of samples (batched into an STL vector) into the outlet.
Parameters:
samplesA vector of samples in some supported format (each sample can be a data pointer, data array, or std vector of data).timestampOptionally the capture time of the most recent sample, in agreement with local_clock(); if omitted, the current time is used. The time stamps of other samples are automatically derived according to the sampling rate of the stream.pushthroughWhether to push the chunk through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.
function push_chunk [2/2]
template<class T>
inline void lsl::stream_outlet::push_chunk (
const std::vector< T > & samples,
const std::vector< double > & timestamps,
bool pushthrough=true
)
Push a chunk of samples (batched into an STL vector) into the outlet. Allows to specify a separate time stamp for each sample (for irregular-rate streams).
Parameters:
samplesA vector of samples in some supported format (each sample can be a data pointer, data array, or std vector of data).timestampsA vector of capture times for each sample, in agreement with local_clock().pushthroughWhether to push the chunk through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.
function push_chunk_multiplexed [1/16]
template<typename T>
inline void lsl::stream_outlet::push_chunk_multiplexed (
const std::vector< T > & buffer,
double timestamp=0.0,
bool pushthrough=true
)
function push_chunk_multiplexed [2/16]
template<typename T>
inline void lsl::stream_outlet::push_chunk_multiplexed (
const std::vector< T > & buffer,
const std::vector< double > & timestamps,
bool pushthrough=true
)
Push a chunk of multiplexed data into the outlet. One timestamp per sample is provided. Allows to specify a separate time stamp for each sample (for irregular-rate streams).
Parameters:
bufferA buffer of channel values holding the data for zero or more successive samples to send.timestampsA buffer of timestamp values holding time stamps for each sample in the data buffer.pushthroughWhether to push the chunk through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.
function push_chunk_multiplexed [3/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const float * buffer,
std::size_t buffer_elements,
double timestamp=0.0,
bool pushthrough=true
)
Push a chunk of multiplexed samples into the outlet. Single timestamp provided.
Warning:
The provided buffer size is measured in channel values (e.g., floats), not samples.
Parameters:
bufferA buffer of channel values holding the data for zero or more successive samples to send.buffer_elementsThe number of channel values (of type T) in the buffer. Must be a multiple of the channel count.timestampOptionally the capture time of the most recent sample, in agreement with local_clock(); if omitted, the current time is used. The time stamps of other samples are automatically derived based on the sampling rate of the stream.pushthroughWhether to push the chunk through to the receivers instead of buffering it with subsequent samples. Note that the stream_outlet() constructur parameterchunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.
function push_chunk_multiplexed [4/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const double * buffer,
std::size_t buffer_elements,
double timestamp=0.0,
bool pushthrough=true
)
function push_chunk_multiplexed [5/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const int64_t * buffer,
std::size_t buffer_elements,
double timestamp=0.0,
bool pushthrough=true
)
function push_chunk_multiplexed [6/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const int32_t * buffer,
std::size_t buffer_elements,
double timestamp=0.0,
bool pushthrough=true
)
function push_chunk_multiplexed [7/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const int16_t * buffer,
std::size_t buffer_elements,
double timestamp=0.0,
bool pushthrough=true
)
function push_chunk_multiplexed [8/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const char * buffer,
std::size_t buffer_elements,
double timestamp=0.0,
bool pushthrough=true
)
function push_chunk_multiplexed [9/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const std::string * buffer,
std::size_t buffer_elements,
double timestamp=0.0,
bool pushthrough=true
)
function push_chunk_multiplexed [10/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const float * data_buffer,
const double * timestamp_buffer,
std::size_t data_buffer_elements,
bool pushthrough=true
)
Push a chunk of multiplexed samples into the outlet. One timestamp per sample is provided.
Warning:
Note that the provided buffer size is measured in channel values (e.g., floats) rather than in samples.
Parameters:
data_bufferA buffer of channel values holding the data for zero or more successive samples to send.timestamp_bufferA buffer of timestamp values holding time stamps for each sample in the data buffer.data_buffer_elementsThe number of data values (of type T) in the data buffer. Must be a multiple of the channel count.pushthroughWhether to push the chunk through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.
function push_chunk_multiplexed [11/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const double * data_buffer,
const double * timestamp_buffer,
std::size_t data_buffer_elements,
bool pushthrough=true
)
function push_chunk_multiplexed [12/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const int64_t * data_buffer,
const double * timestamp_buffer,
std::size_t data_buffer_elements,
bool pushthrough=true
)
function push_chunk_multiplexed [13/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const int32_t * data_buffer,
const double * timestamp_buffer,
std::size_t data_buffer_elements,
bool pushthrough=true
)
function push_chunk_multiplexed [14/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const int16_t * data_buffer,
const double * timestamp_buffer,
std::size_t data_buffer_elements,
bool pushthrough=true
)
function push_chunk_multiplexed [15/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const char * data_buffer,
const double * timestamp_buffer,
std::size_t data_buffer_elements,
bool pushthrough=true
)
function push_chunk_multiplexed [16/16]
inline void lsl::stream_outlet::push_chunk_multiplexed (
const std::string * data_buffer,
const double * timestamp_buffer,
std::size_t data_buffer_elements,
bool pushthrough=true
)
function push_chunk_numeric_structs [1/2]
template<class T>
inline void lsl::stream_outlet::push_chunk_numeric_structs (
const std::vector< T > & samples,
double timestamp=0.0,
bool pushthrough=true
)
Push a chunk of numeric data as C-style structs (batched into an STL vector) into the outlet. This performs some size checking but no type checking. Can not be used for variable-size / string-formatted data.
Parameters:
samplesA vector of samples, as C structs.timestampOptionally the capture time of the sample, in agreement with local_clock(); if omitted, the current time is used.pushthroughWhether to push the chunk through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.
function push_chunk_numeric_structs [2/2]
template<class T>
inline void lsl::stream_outlet::push_chunk_numeric_structs (
const std::vector< T > & samples,
const std::vector< double > & timestamps,
bool pushthrough=true
)
Push a chunk of numeric data from C-style structs (batched into an STL vector), into the outlet. This performs some size checking but no type checking. Can not be used for variable-size / string-formatted data.
Parameters:
samplesA vector of samples, as C structs.timestampsA vector of capture times for each sample, in agreement with local_clock().pushthroughWhether to push the chunk through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.
function push_numeric_raw
inline void lsl::stream_outlet::push_numeric_raw (
const void * sample,
double timestamp=0.0,
bool pushthrough=true
)
Push a pointer to raw numeric data as one sample into the outlet. This is the lowest-level function; performs no checking whatsoever. Cannot be used for variable-size / string-formatted channels.
Parameters:
sampleA pointer to the raw sample data to push.timestampOptionally the capture time of the sample, in agreement with local_clock(); if omitted, the current time is used.pushthroughWhether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.
function push_numeric_struct
template<class T>
inline void lsl::stream_outlet::push_numeric_struct (
const T & sample,
double timestamp=0.0,
bool pushthrough=true
)
Push a packed C struct (of numeric data) as one sample into the outlet (search for #``pragma pack for information on packing structs appropriately).
Overall size checking but no type checking or conversion are done.
Can not be used forvariable-size / string-formatted data.
Parameters:
sampleThe sample struct to push.timestampOptionally the capture time of the sample, in agreement with local_clock(); if omitted, the current time is used.pushthroughWhether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.
function push_sample [1/9]
template<class T, int32_t N>
inline void lsl::stream_outlet::push_sample (
const T data,
double timestamp=0.0,
bool pushthrough=true
)
Push a C array of values as a sample into the outlet. Each entry in the array corresponds to one channel. The function handles type checking & conversion.
Parameters:
dataAn array of values to push (one per channel).timestampOptionally the capture time of the sample, in agreement with lsl::local_clock(); if omitted, the current time is used.pushthroughWhether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.
function push_sample [2/9]
template<typename T>
inline void lsl::stream_outlet::push_sample (
const std::vector< T > & data,
double timestamp=0.0,
bool pushthrough=true
)
Push a std vector of values as a sample into the outlet. Each entry in the vector corresponds to one channel. The function handles type checking & conversion.
Parameters:
dataA vector of values to push (one for each channel).timestampOptionally the capture time of the sample, in agreement with local_clock(); if omitted, the current time is used.pushthroughWhether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.
function push_sample [3/9]
inline void lsl::stream_outlet::push_sample (
const float * data,
double timestamp=0.0,
bool pushthrough=true
)
Push a pointer to some values as a sample into the outlet. This is a lower-level function for cases where data is available in some buffer. Handles type checking & conversion.
Parameters:
dataA pointer to values to push. The number of values pointed to must not be less than the number of channels in the sample.timestampOptionally the capture time of the sample, in agreement with local_clock(); if omitted, the current time is used.pushthroughWhether to push the sample through to the receivers instead of buffering it with subsequent samples. Note that the chunk_size, if specified at outlet construction, takes precedence over the pushthrough flag.
function push_sample [4/9]
inline void lsl::stream_outlet::push_sample (
const double * data,
double timestamp=0.0,
bool pushthrough=true
)
function push_sample [5/9]
inline void lsl::stream_outlet::push_sample (
const int64_t * data,
double timestamp=0.0,
bool pushthrough=true
)
function push_sample [6/9]
inline void lsl::stream_outlet::push_sample (
const int32_t * data,
double timestamp=0.0,
bool pushthrough=true
)
function push_sample [7/9]
inline void lsl::stream_outlet::push_sample (
const int16_t * data,
double timestamp=0.0,
bool pushthrough=true
)
function push_sample [8/9]
inline void lsl::stream_outlet::push_sample (
const char * data,
double timestamp=0.0,
bool pushthrough=true
)
function push_sample [9/9]
inline void lsl::stream_outlet::push_sample (
const std::string * data,
double timestamp=0.0,
bool pushthrough=true
)
function stream_outlet [1/3]
stream_outlet move constructor
function stream_outlet [3/3]
inline lsl::stream_outlet::stream_outlet (
const stream_info & info,
int32_t chunk_size=0,
int32_t max_buffered=360,
lsl_transport_options_t flags=transp_default
)
Establish a new stream outlet. This makes the stream discoverable.
Parameters:
infoThe stream information to use for creating this stream. Stays constant over the lifetime of the outlet.chunk_sizeOptionally the desired chunk granularity (in samples) for transmission. If unspecified, each push operation yields one chunk. Inlets can override this setting.max_bufferedOptionally the maximum amount of data to buffer (in seconds if there is a nominal sampling rate, otherwise x100 in samples). The default is 6 minutes of data.
function wait_for_consumers
Wait until some consumer shows up (without wasting resources).
Returns:
True if the wait was successful, false if the timeout expired.
function ~stream_outlet
Destructor. The stream will no longer be discoverable after destruction and all paired inlets will stop delivering data.
The documentation for this class was generated from the following file liblsl/include/lsl_cpp.h