Control Surface pin-t-adl
MIDI Control Surface library for Arduino
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
MIDIMessageQueue Class Reference

#include <MIDI_Interfaces/BLEMIDI/MIDIMessageQueue.hpp>

Detailed Description

Definition at line 10 of file MIDIMessageQueue.hpp.

+ Collaboration diagram for MIDIMessageQueue:

Classes

struct  MIDIMessageQueueElement
 

Public Types

using storage_t = std::vector< MIDIMessageQueueElement >
 
using iter_t = storage_t::iterator
 

Public Member Functions

 MIDIMessageQueue (size_t capacity)
 
bool push (ChannelMessage message, uint16_t timestamp)
 
bool push (SysCommonMessage message, uint16_t timestamp)
 
bool push (RealTimeMessage message, uint16_t timestamp)
 
bool push (SysExMessage message, uint16_t timestamp)
 
bool pop (MIDIMessageQueueElement &message)
 

Private Member Functions

bool push (MIDIMessageQueueElement &&message)
 
void inc (iter_t &it)
 

Private Attributes

storage_t storage = storage_t(64)
 
iter_t write_p = storage.begin()
 
iter_t read_p = storage.begin()
 
std::atomic_size_t size {0}
 

Member Typedef Documentation

◆ storage_t

using storage_t = std::vector<MIDIMessageQueueElement>

Definition at line 58 of file MIDIMessageQueue.hpp.

◆ iter_t

using iter_t = storage_t::iterator

Definition at line 59 of file MIDIMessageQueue.hpp.

Constructor & Destructor Documentation

◆ MIDIMessageQueue()

MIDIMessageQueue ( size_t  capacity)
inline

Definition at line 12 of file MIDIMessageQueue.hpp.

Member Function Documentation

◆ push() [1/5]

bool push ( ChannelMessage  message,
uint16_t  timestamp 
)

◆ push() [2/5]

bool push ( SysCommonMessage  message,
uint16_t  timestamp 
)

◆ push() [3/5]

bool push ( RealTimeMessage  message,
uint16_t  timestamp 
)

◆ push() [4/5]

bool push ( SysExMessage  message,
uint16_t  timestamp 
)

◆ pop()

bool pop ( MIDIMessageQueueElement message)

◆ push() [5/5]

bool push ( MIDIMessageQueueElement &&  message)
private

◆ inc()

void inc ( iter_t it)
inlineprivate

Definition at line 77 of file MIDIMessageQueue.hpp.

Member Data Documentation

◆ storage

storage_t storage = storage_t(64)
private

Definition at line 70 of file MIDIMessageQueue.hpp.

◆ write_p

iter_t write_p = storage.begin()
private

Definition at line 71 of file MIDIMessageQueue.hpp.

◆ read_p

iter_t read_p = storage.begin()
private

Definition at line 72 of file MIDIMessageQueue.hpp.

◆ size

std::atomic_size_t size {0}
private

Definition at line 73 of file MIDIMessageQueue.hpp.


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