JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
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>

Collaboration diagram for juce::midi_ci::InitiatorPropertyExchangeCache:

Public Member Functions

 InitiatorPropertyExchangeCache ()
 
 InitiatorPropertyExchangeCache (InitiatorPropertyExchangeCache &&) noexcept
 
 ~InitiatorPropertyExchangeCache ()
 
void addChunk (RequestID, const Message::DynamicSizePropertyExchange &chunk)
 Adds a message chunk for the provided transaction id.
 
std::vector< Token64getOngoingTransactions () const
 Returns all ongoing transactions.
 
std::optional< RequestIDgetRequestIdForToken (Token64) const
 If the token refers to an ongoing transaction, returns the request id of that transaction.
 
std::optional< Token64getTokenForRequestId (RequestID) const
 If there's a transaction ongoing with the given request id, returns the token uniquely identifying that transaction, otherwise returns nullopt.
 
void notify (RequestID, Span< const std::byte > header)
 Updates the transaction state based on the contents of the provided notification.
 
InitiatorPropertyExchangeCacheoperator= (InitiatorPropertyExchangeCache &&) noexcept
 
std::optional< Token64primeCache (uint8_t maxSimultaneousRequests, std::function< void(const PropertyExchangeResult &)> onDone)
 Picks an unused request ID, and prepares the cache for that ID to accumulate message chunks.
 
bool terminate (Token64)
 Terminates/cancels an ongoing transaction.
 

Private Attributes

std::unique_ptr< Impl > pimpl
 

Detailed Description

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

@tags{Audio}

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

◆ addChunk()

void juce::midi_ci::InitiatorPropertyExchangeCache::addChunk ( RequestID  ,
const Message::DynamicSizePropertyExchange chunk 
)

Adds a message chunk for the provided transaction id.

◆ getOngoingTransactions()

std::vector< Token64 > juce::midi_ci::InitiatorPropertyExchangeCache::getOngoingTransactions ( ) const

Returns all ongoing transactions.

◆ getRequestIdForToken()

std::optional< RequestID > juce::midi_ci::InitiatorPropertyExchangeCache::getRequestIdForToken ( Token64  ) const

If the token refers to an ongoing transaction, returns the request id of that transaction.

Otherwise, returns an invalid request id.

◆ getTokenForRequestId()

std::optional< Token64 > juce::midi_ci::InitiatorPropertyExchangeCache::getTokenForRequestId ( RequestID  ) const

If there's a transaction ongoing with the given request id, returns the token uniquely identifying that transaction, otherwise returns nullopt.

◆ notify()

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

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

◆ operator=()

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

◆ primeCache()

std::optional< Token64 > juce::midi_ci::InitiatorPropertyExchangeCache::primeCache ( uint8_t  maxSimultaneousRequests,
std::function< void(const PropertyExchangeResult &)>  onDone 
)

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.

◆ terminate()

bool juce::midi_ci::InitiatorPropertyExchangeCache::terminate ( Token64  )

Terminates/cancels an ongoing transaction.

Returns true if the termination had an effect (i.e. the transaction was still ongoing), or false otherwise (the transaction already ended or never started).

Member Data Documentation

◆ pimpl

std::unique_ptr<Impl> juce::midi_ci::InitiatorPropertyExchangeCache::pimpl
private

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