JUCE
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
juce::midi_ci::InitiatorPropertyExchangeCache Class Reference

Accumulates message chunks that have been sent by another device in response to a transaction initiated by a local device. More...

#include <juce_CIPropertyExchangeCache.h>

Classes

struct  TokenAndId
 Holds a token that can be used to stop waiting for a reply, along with an identifier byte that uniquely identifies an ongoing transaction. More...
 

Public Member Functions

 InitiatorPropertyExchangeCache ()
 
 ~InitiatorPropertyExchangeCache ()
 
 InitiatorPropertyExchangeCache (InitiatorPropertyExchangeCache &&) noexcept
 
InitiatorPropertyExchangeCacheoperator= (InitiatorPropertyExchangeCache &&) noexcept
 
TokenAndId primeCache (uint8_t maxSimultaneousRequests, std::function< void(const PropertyExchangeResult &)> onDone, std::function< void(std::byte)> onTerminate)
 Picks an unused request ID, and prepares the cache for that ID to accumulate message chunks.
 
void addChunk (std::byte b, const Message::DynamicSizePropertyExchange &chunk)
 Adds a message chunk for the provided transaction id.
 
void notify (std::byte b, Span< const std::byte > header)
 Updates the transaction state based on the contents of the provided notification.
 
int countOngoingTransactions () const
 Returns the number of transactions that have been started but not finished.
 
bool isAwaitingResponse () const
 Returns true if there are any transactions in progress that haven't yet received replies.
 

Detailed Description

Accumulates message chunks that have been sent by another device in response to a transaction initiated by a local device.

Constructor & Destructor Documentation

◆ InitiatorPropertyExchangeCache() [1/2]

juce::midi_ci::InitiatorPropertyExchangeCache::InitiatorPropertyExchangeCache ( )

◆ ~InitiatorPropertyExchangeCache()

juce::midi_ci::InitiatorPropertyExchangeCache::~InitiatorPropertyExchangeCache ( )

◆ InitiatorPropertyExchangeCache() [2/2]

juce::midi_ci::InitiatorPropertyExchangeCache::InitiatorPropertyExchangeCache ( InitiatorPropertyExchangeCache &&  )
noexcept

Member Function Documentation

◆ operator=()

InitiatorPropertyExchangeCache & juce::midi_ci::InitiatorPropertyExchangeCache::operator= ( InitiatorPropertyExchangeCache &&  )
noexcept

◆ primeCache()

TokenAndId juce::midi_ci::InitiatorPropertyExchangeCache::primeCache ( uint8_t  maxSimultaneousRequests,
std::function< void(const PropertyExchangeResult &)>  onDone,
std::function< void(std::byte)>  onTerminate 
)

Picks an unused request ID, and prepares the cache for that ID to accumulate message chunks.

Incoming chunks added with addChunk are generated by another device acting as a responder.

◆ addChunk()

void juce::midi_ci::InitiatorPropertyExchangeCache::addChunk ( std::byte  b,
const Message::DynamicSizePropertyExchange chunk 
)

Adds a message chunk for the provided transaction id.

◆ notify()

void juce::midi_ci::InitiatorPropertyExchangeCache::notify ( std::byte  b,
Span< const std::byte >  header 
)

Updates the transaction state based on the contents of the provided notification.

◆ countOngoingTransactions()

int juce::midi_ci::InitiatorPropertyExchangeCache::countOngoingTransactions ( ) const

Returns the number of transactions that have been started but not finished.

◆ isAwaitingResponse()

bool juce::midi_ci::InitiatorPropertyExchangeCache::isAwaitingResponse ( ) const

Returns true if there are any transactions in progress that haven't yet received replies.


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