The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
ac2lsl::save_var_t< T > Class Template Reference

Implementation for all ac to lsl bridges except complex types. More...

Inheritance diagram for ac2lsl::save_var_t< T >:
Inheritance graph

Public Member Functions

 save_var_t (const std::string &name_, const std::string &type_, unsigned num_channels_, const mha_real_t rate_, const lsl::channel_format_t format_, const std::string &source_id_, void *data_, const unsigned data_type_)
 C'tor of generic ac to lsl bridge. More...
 
virtual void * get_buf_address () const noexcept override
 Get buffer address as void pointer. More...
 
virtual void set_buf_address (void *data) override
 Cast the input pointer to the appropriate type and set the buffer address. More...
 
virtual lsl::stream_info info () const noexcept override
 Get stream info object from stream outlet. More...
 
virtual unsigned data_type () const noexcept override
 Get data type id according MHA convention. More...
 
virtual ~save_var_t ()=default
 
virtual void send_frame (unsigned num_entries) override
 Send a frame to lsl. More...
 
- Public Member Functions inherited from ac2lsl::save_var_base_t
virtual ~save_var_base_t ()=default
 

Private Attributes

lsl::stream_outlet stream
 LSL stream outlet. More...
 
T * buf
 Pointer to data buffer of the ac variable. More...
 
const unsigned data_type_
 Data type id according to MHA convention. More...
 

Detailed Description

template<typename T>
class ac2lsl::save_var_t< T >

Implementation for all ac to lsl bridges except complex types.

Constructor & Destructor Documentation

◆ save_var_t()

template<typename T >
ac2lsl::save_var_t< T >::save_var_t ( const std::string &  name_,
const std::string &  type_,
unsigned  num_channels_,
const mha_real_t  rate_,
const lsl::channel_format_t  format_,
const std::string &  source_id_,
void *  data_,
const unsigned  data_type_ 
)
inline

C'tor of generic ac to lsl bridge.

Parameters
infoLSL stream info object containing metadata
dataPointer to data buffer of the ac variable
data_typeType id of the stream, in mha convention. Should be set to one if not a vector.

◆ ~save_var_t()

template<typename T >
virtual ac2lsl::save_var_t< T >::~save_var_t ( )
virtualdefault

Member Function Documentation

◆ get_buf_address()

template<typename T >
virtual void* ac2lsl::save_var_t< T >::get_buf_address ( ) const
inlineoverridevirtualnoexcept

Get buffer address as void pointer.

Returns
Adress of the data buffer

Implements ac2lsl::save_var_base_t.

◆ set_buf_address()

template<typename T >
virtual void ac2lsl::save_var_t< T >::set_buf_address ( void *  data)
inlineoverridevirtual

Cast the input pointer to the appropriate type and set the buffer address.

Parameters
dataNew buffer address

Implements ac2lsl::save_var_base_t.

◆ info()

template<typename T >
virtual lsl::stream_info ac2lsl::save_var_t< T >::info ( ) const
inlineoverridevirtualnoexcept

Get stream info object from stream outlet.

Implements ac2lsl::save_var_base_t.

◆ data_type()

template<typename T >
virtual unsigned ac2lsl::save_var_t< T >::data_type ( ) const
inlineoverridevirtualnoexcept

Get data type id according MHA convention.

Implements ac2lsl::save_var_base_t.

◆ send_frame()

template<typename T >
virtual void ac2lsl::save_var_t< T >::send_frame ( unsigned  num_entries)
inlineoverridevirtual

Send a frame to lsl.

Implements ac2lsl::save_var_base_t.

Member Data Documentation

◆ stream

template<typename T >
lsl::stream_outlet ac2lsl::save_var_t< T >::stream
private

LSL stream outlet.

Interface to lsl

◆ buf

template<typename T >
T* ac2lsl::save_var_t< T >::buf
private

Pointer to data buffer of the ac variable.

◆ data_type_

template<typename T >
const unsigned ac2lsl::save_var_t< T >::data_type_
private

Data type id according to MHA convention.


The documentation for this class was generated from the following file: