JUCE: juce::midi_ci::PropertyExchangeResult Class Reference

JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
juce::midi_ci::PropertyExchangeResult Class Reference
juce_midi_ci » ci

Contains data returned by a responder in response to a request. More...

`#include <juce_CIPropertyExchangeResult.h>`

## Public Types
enum class | Error { partial , notify , tooManyTransactions , invalidPayload }

## Public Member Functions
| PropertyExchangeResult (Error errorIn)
| Creates a result denoting an error state.
| PropertyExchangeResult (var headerIn, Span< const std::byte > bodyIn)
| Creates a result denoting a successful transmission.
std::optional< Error > | getError () const
| Returns the result kind, either nullopt for a successful transmission, or an error code if something went wrong.
PropertySubscriptionHeader | getHeaderAsSubscriptionHeader () const
| Parses the header as a subscription header.
PropertyRequestHeader | getHeaderAsRequestHeader () const
| Parses the header as a request header.
PropertyReplyHeader | getHeaderAsReplyHeader () const
| Parses the header as a reply header.
Span< const std::byte > | getBody () const
| When getKind returns 'full', this is the message payload.

## Detailed Description

Contains data returned by a responder in response to a request.

PropertyExchangeResult::kind indicates whether the transaction resulted in a well-formed message; however, it's possible that the message is a well-formed message indicating an error in the responder, so it's important to check the 'status' field of the header before attempting to do anything with the payload.

## Member Enumeration Documentation

## ◆ Error

enum class juce::midi_ci::PropertyExchangeResult::Error
| strong

Enumerator
partial | Got a response, but the responder terminated it before sending a well-formed message.
notify | Got a notify message terminating the transaction.
tooManyTransactions | Unable to send the request because doing so would exceed the number of simultaneous inquiries that were declared. See also PropertyDelegate::getNumSimultaneousRequestsSupported().
invalidPayload | The payload couldn't be encoded for transmission. If you're using the ASCII encoding, maybe some bytes have their most significant bit set.

## Constructor & Destructor Documentation

## ◆ PropertyExchangeResult() [1/2]

juce::midi_ci::PropertyExchangeResult::PropertyExchangeResult | ( | Error | errorIn | ) |
| explicit

Creates a result denoting an error state.

## ◆ PropertyExchangeResult() [2/2]

juce::midi_ci::PropertyExchangeResult::PropertyExchangeResult | ( | var | headerIn,
|  | Span< const std::byte > | bodyIn
| ) |  |

Creates a result denoting a successful transmission.

## Member Function Documentation

## ◆ getError()

std::optional< Error > juce::midi_ci::PropertyExchangeResult::getError | ( |  | ) | const

Returns the result kind, either nullopt for a successful transmission, or an error code if something went wrong.

## ◆ getHeaderAsSubscriptionHeader()

PropertySubscriptionHeader juce::midi_ci::PropertyExchangeResult::getHeaderAsSubscriptionHeader | ( |  | ) | const

Parses the header as a subscription header.

This may only be called for messages of kind 'full'.

References jassert, and juce::midi_ci::PropertySubscriptionHeader::parseCondensed().

## ◆ getHeaderAsRequestHeader()

PropertyRequestHeader juce::midi_ci::PropertyExchangeResult::getHeaderAsRequestHeader | ( |  | ) | const

Parses the header as a request header.

This may only be called for messages of kind 'full'.

References jassert, and juce::midi_ci::PropertyRequestHeader::parseCondensed().

## ◆ getHeaderAsReplyHeader()

PropertyReplyHeader juce::midi_ci::PropertyExchangeResult::getHeaderAsReplyHeader | ( |  | ) | const

Parses the header as a reply header.

This may only be called for messages of kind 'full'.

References jassert, and juce::midi_ci::PropertyReplyHeader::parseCondensed().

## ◆ getBody()

Span< const std::byte > juce::midi_ci::PropertyExchangeResult::getBody | ( |  | ) | const

When getKind returns 'full', this is the message payload.

Note that this is not stored internally; if you need to keep this data around and reference it in the future, you should copy it into a vector or some other suitable container.

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

- juce_CIPropertyExchangeResult.h