Open Lighting Architecture  Latest Git
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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:

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. More...
 
 RDMReply (RDMStatusCode status_code, RDMResponse *response, const RDMFrames &frames)
 Create a RDMReply with a response code and response object. More...
 
RDMStatusCode StatusCode () const
 Return the RDMStatusCode for the request.
 
const RDMResponseResponse () const
 Returns the RDMResponse if there is one. More...
 
RDMResponseMutableResponse ()
 Returns a pointer to a mutable RDMResponse. More...
 
const RDMFramesFrames () const
 The frames that make up this RDM reply. More...
 
bool operator== (const RDMReply &other) const
 Test for equality. More...
 

Static Public Member Functions

static RDMReplyFromFrame (const RDMFrame &frame, const RDMRequest *request=NULL)
 A helper method to create a RDMReply from raw frame data. More...
 
static RDMReplyDUBReply (const RDMFrame &frame)
 A helper method to create a RDMReply for a DUB response. More...
 

String Methods

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

Constructor & Destructor Documentation

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

Create a RDMReply with a response code and response object.

Parameters
status_codeThe RDMStatusCode.
responseThe RDMResponse object, ownership is transferred.
ola::rdm::RDMReply::RDMReply ( RDMStatusCode  status_code,
RDMResponse response,
const RDMFrames frames 
)

Create a RDMReply with a response code and response object.

Parameters
status_codeThe RDMStatusCode.
responseThe RDMResponse object, ownership is transferred.
framesThe raw RDM frames that make up the response.

Member Function Documentation

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

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

Parameters
frameA RDMFrame of DUB data.
Returns
A new RDMReply object, with a StatusCode() of RDM_DUB_RESPONSE and a NULL RDMResponse.
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.

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
frameA RDMFrame.
requestAn optional RDMRequest that triggered this response.
Returns
A new RDMReply object.
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.

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

Test for equality.

Parameters
otherThe RDMReply to test against.
Returns
True if two RDMReplies are equal.
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.

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 Function Documentation

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

Output an RDMReply object to an ostream.

Parameters
outostream to output to
replyis the RDMReply to print
See also
ToString()

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