Public Types | Public Member Functions | List of all members
universal_midi_packets::Iterator Class Reference

Enables iteration over a collection of Universal MIDI Packets stored as a contiguous range of 32-bit words. More...

Public Types

using difference_type = std::iterator_traits< const uint32_t * >::difference_type
 
using value_type = View
 
using reference = const View &
 
using pointer = const View *
 
using iterator_category = std::input_iterator_tag
 

Public Member Functions

 Iterator () noexcept=default
 Creates an invalid (singular) iterator. More...
 
 Iterator (const uint32_t *ptr, size_t bytes) noexcept
 Creates an iterator pointing at ptr. More...
 
Iteratoroperator++ () noexcept
 Moves this iterator to the next packet in the range. More...
 
Iterator operator++ (int) noexcept
 Moves this iterator to the next packet in the range, returning the value of the iterator before it was incremented. More...
 
bool operator== (const Iterator &other) const noexcept
 Returns true if this iterator points to the same address as another iterator. More...
 
bool operator!= (const Iterator &other) const noexcept
 Returns false if this iterator points to the same address as another iterator. More...
 
reference operator* () noexcept
 Returns a reference to a View of the packet currently pointed-to by this iterator. More...
 
pointer operator-> () noexcept
 Returns a pointer to a View of the packet currently pointed-to by this iterator. More...
 

Detailed Description

Enables iteration over a collection of Universal MIDI Packets stored as a contiguous range of 32-bit words.

This iterator is used by Packets to allow access to the messages that it contains.

Member Typedef Documentation

◆ difference_type

using universal_midi_packets::Iterator::difference_type = std::iterator_traits<const uint32_t*>::difference_type

◆ value_type

◆ reference

◆ pointer

◆ iterator_category

using universal_midi_packets::Iterator::iterator_category = std::input_iterator_tag

Constructor & Destructor Documentation

◆ Iterator() [1/2]

universal_midi_packets::Iterator::Iterator ( )
defaultnoexcept

Creates an invalid (singular) iterator.

◆ Iterator() [2/2]

universal_midi_packets::Iterator::Iterator ( const uint32_t *  ptr,
size_t  bytes 
)
explicitnoexcept

Creates an iterator pointing at ptr.

References ignoreUnused().

Member Function Documentation

◆ operator++() [1/2]

Iterator& universal_midi_packets::Iterator::operator++ ( )
noexcept

Moves this iterator to the next packet in the range.

References universal_midi_packets::View::data(), jassert, and universal_midi_packets::View::size().

◆ operator++() [2/2]

Iterator universal_midi_packets::Iterator::operator++ ( int  )
noexcept

Moves this iterator to the next packet in the range, returning the value of the iterator before it was incremented.

References StandardApplicationCommandIDs::copy.

◆ operator==()

bool universal_midi_packets::Iterator::operator== ( const Iterator other) const
noexcept

Returns true if this iterator points to the same address as another iterator.

Referenced by operator!=().

◆ operator!=()

bool universal_midi_packets::Iterator::operator!= ( const Iterator other) const
noexcept

Returns false if this iterator points to the same address as another iterator.

References operator==().

◆ operator*()

reference universal_midi_packets::Iterator::operator* ( )
noexcept

Returns a reference to a View of the packet currently pointed-to by this iterator.

The View can be queried for its size and content.

◆ operator->()

pointer universal_midi_packets::Iterator::operator-> ( )
noexcept

Returns a pointer to a View of the packet currently pointed-to by this iterator.

The View can be queried for its size and content.


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