Open Lighting Architecture: ola::rdm::RDMReply Struct Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
ola::rdm::RDMReply Struct Reference

## Detailed Description

Holds the final state of an RDM request.

When a RDM request completes, the following information is returned:

- The RDMStatusCode.
- An RDMResponse, if the response data was a valid RDM response.
- Raw data, including response timing information if provided.

## Public Member Functions
| RDMReply (RDMStatusCode status_code)
| Create a new RDMReply from a RDM Response Code.
| RDMReply (RDMStatusCode status_code, RDMResponse *response)
| Create a RDMReply with a response code and response object.
| RDMReply (RDMStatusCode status_code, RDMResponse *response, const RDMFrames &frames)
| Create a RDMReply with a response code and response object.
RDMStatusCode | StatusCode () const
| Return the RDMStatusCode for the request.
const RDMResponse * | Response () const
| Returns the RDMResponse if there is one.
RDMResponse * | MutableResponse ()
| Returns a pointer to a mutable RDMResponse.
const RDMFrames & | Frames () const
| The frames that make up this RDM reply.
bool | operator== (const RDMReply &other) const
| Test for equality.

## Static Public Member Functions
static RDMReply * | FromFrame (const RDMFrame &frame, const RDMRequest *request=NULL)
| A helper method to create a RDMReply from raw frame data.
static RDMReply * | DUBReply (const RDMFrame &frame)
| A helper method to create a RDMReply for a DUB response.

## String Methods
std::string | ToString () const
| Create a human readable string from the RDMReply object.
std::ostream & | operator<< (std::ostream &out, const RDMReply &reply)
| Output an RDMReply object to an ostream.

## Constructor & Destructor Documentation

## ◆ RDMReply() [1/2]

ola::rdm::RDMReply::RDMReply | ( | RDMStatusCode | status_code,
|  | RDMResponse * | response )

Create a RDMReply with a response code and response object.

Parameters

  status_code | The RDMStatusCode.
  response | The RDMResponse object, ownership is transferred.

## ◆ RDMReply() [2/2]

ola::rdm::RDMReply::RDMReply | ( | RDMStatusCode | status_code,
|  | RDMResponse * | response,
|  | const RDMFrames & | frames )

Create a RDMReply with a response code and response object.

Parameters

  status_code | The RDMStatusCode.
  response | The RDMResponse object, ownership is transferred.
  frames | The raw RDM frames that make up the response.

## Member Function Documentation

## ◆ DUBReply()

RDMReply * ola::rdm::RDMReply::DUBReply | ( | const RDMFrame & | frame | ) |
| static

A helper method to create a RDMReply for a DUB response.

Parameters

  frame | A RDMFrame of DUB data.

Returns
  A new RDMReply object, with a StatusCode() of RDM_DUB_RESPONSE and a NULL RDMResponse.

## ◆ Frames()

const RDMFrames & ola::rdm::RDMReply::Frames | ( |  | ) | const
| inline

The frames that make up this RDM reply.

This may be empty, if the raw frame data was not available.

## ◆ FromFrame()

RDMReply * ola::rdm::RDMReply::FromFrame | ( | const RDMFrame & | frame,
|  | const RDMRequest * | request = NULL )
| static

A helper method to create a RDMReply from raw frame data.

Parameters

  frame | A RDMFrame.
  request | An optional RDMRequest that triggered this response.

Returns
  A new RDMReply object.

## ◆ MutableResponse()

RDMResponse * ola::rdm::RDMReply::MutableResponse | ( |  | ) |
| inline

Returns a pointer to a mutable RDMResponse.

Returns
  A RDMResponse object or NULL if the response data was not a valid RDM message.

The returned pointer is valid for the lifetime of the RDMReply object.

## ◆ operator==()

bool ola::rdm::RDMReply::operator== | ( | const RDMReply & | other | ) | const

Test for equality.

Parameters

  other | The RDMReply to test against.

Returns
  True if two RDMReplies are equal.

## ◆ Response()

const RDMResponse * ola::rdm::RDMReply::Response | ( |  | ) | const
| inline

Returns the RDMResponse if there is one.

Returns
  A RDMResponse object or NULL if the response data was not a valid RDM message.

The returned pointer is valid for the lifetime of the RDMReply object.

## ◆ ToString()

std::string ola::rdm::RDMReply::ToString | ( |  | ) | const

Create a human readable string from the RDMReply object.

Returns
  A string representation of the RDMReply.

## Friends And Related Symbol Documentation

## ◆ operator<<

std::ostream & operator<< | ( | std::ostream & | out,
|  | const RDMReply & | reply )
| friend

Output an RDMReply object to an ostream.

Parameters

  out | ostream to output to
  reply | is the RDMReply to print

See also
  ToString()

The documentation for this struct was generated from the following files:

- include/ola/rdm/RDMReply.h
- common/rdm/RDMReply.cpp