Loading...
Searching...
No Matches
juce::midi_ci::PropertyExchangeResult Class Reference

## 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.

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

- juce_midi_ci/ci/juce_CIPropertyExchangeResult.h

## Public Types

enum class | Error { partial , notify , tooManyTransactions }

## 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.

## Member Enums

## 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().

## Constructors and Destructors

## PropertyExchangeResult() [1/2]

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

inline explicit

Creates a result denoting an error state.

References PropertyExchangeResult().

Referenced by PropertyExchangeResult(), and PropertyExchangeResult().

## PropertyExchangeResult() [2/2]

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

inline

Creates a result denoting a successful transmission.

References juce::nullopt, and PropertyExchangeResult().

## Member Functions

## getError()

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

inline

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

inline

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

inline

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

inline

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

inline

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.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited