|
pianod2
multisource multiuser scriptable networked music player
|
Container for multiple Responses.
More...
#include <response.h>


Public Member Functions | |
| ResponseGroup ()=default | |
| ResponseGroup (ResponseGroup &&)=default | |
| ResponseGroup & | operator= (ResponseGroup &&)=default |
| ResponseGroup (Response &&r) | |
| Construct from a single response. More... | |
| template<typename... Parameters> | |
| void | operator() (Parameters &&...params) |
| Add a new response to the list, after constructing it. More... | |
| void | operator() (ResponseGroup &&) |
| Merge members from another ResponseGroup. More... | |
| void | transmit (class PianodService &) const |
| Transmit a group of response messages to all nodes on a service, using the appropriate protocol for each node. More... | |
| void | transmitLine (PianodConnection &, int offset=Response::TransmitUnaltered) const |
| Transmit a group of responses to the client. More... | |
| void | transmit (class PianodConnection &) const |
| Transmit a group of response messages to a single node using the node's selected protocol. More... | |
Private Member Functions | |
| Parsnip::Data | serializeReply () const |
| Format successes or diagnostics for JSON transmission. More... | |
| Parsnip::Data | serializeData (const User *) const |
| Format a record's worth of reponses for JSON protocol. More... | |
| Parsnip::Data | serializeHomogenousData (const User *) const |
| Format a homogenous list of responses as a series JSON records. More... | |
| Parsnip::Data | serializeEvents (bool, const User *) const |
| Re-sort messages to be broadcast into categories: More... | |
| void | transmitLine (class PianodService &) const |
| Broadcast a group of responses to an entire service. More... | |
| void | transmitJSON (class PianodService &) const |
| Transmit a group of responses JSON connection on a service. More... | |
Friends | |
| class | ResponseCollector |
Container for multiple Responses.
May contain any type, but for data, success and command errors contents should be consistent. Others types may mix. For performance, this avoids copy constructors/adders and provides only move constructors/adders.
|
default |
|
default |
|
inline |
Construct from a single response.
|
inline |
Add a new response to the list, after constructing it.
| void ResponseGroup::operator() | ( | ResponseGroup && | merge_from | ) |
Merge members from another ResponseGroup.
| merge_from | The other group. |
|
default |
|
private |
Format a record's worth of reponses for JSON protocol.


|
private |
Re-sort messages to be broadcast into categories:
| inline_details | If true, include user-specific info (ratings). |
| user | The user for whom to include details. |


|
private |
Format a homogenous list of responses as a series JSON records.


|
private |
Format successes or diagnostics for JSON transmission.


| void ResponseGroup::transmit | ( | class PianodConnection & | destination | ) | const |
Transmit a group of response messages to a single node using the node's selected protocol.
| destination | The node to direct the responses to. |

| void ResponseGroup::transmit | ( | class PianodService & | destination | ) | const |
Transmit a group of response messages to all nodes on a service, using the appropriate protocol for each node.
| destination | The service to direct the responses to. |


|
private |
Transmit a group of responses JSON connection on a service.
If the responses include the current song, follow up with user-specific ratings and actions.
| destination | The service to which to send responses. |


|
private |
Broadcast a group of responses to an entire service.
| service | The service whose clients to send to. |

| void ResponseGroup::transmitLine | ( | PianodConnection & | there, |
| int | offset = Response::TransmitUnaltered |
||
| ) | const |
Transmit a group of responses to the client.
| there | The target to send to. |
| offset | If unspecified, sends messages as-is. Set to TransmitAsDiagnostic to send command error messages as diagnostics. |
|
friend |