AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message Class Reference

#include <Message.h>

Inheritance diagram for alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message:
Collaboration graph
[legend]

Public Member Functions

 Message (const std::string &nameSpace, const int version, const std::string &name)
 
MessageaddMember (const std::string &name, const std::string &value)
 
MessageaddMember (const std::string &name, unsigned value)
 
MessageaddMemberInPayload (const std::string &name, const std::string &value)
 
MessageaddIntegerInPayload (const std::string &name, const int value)
 
MessageaddMemberInPayload (const std::string &name, unsigned value)
 
MessagesetEnabledInPayload (bool enabled)
 
MessagesetStateInPayload (const std::string &state)
 
MessagesetTokenInPayload (const std::string &token)
 
MessagesetTokenInPayload (unsigned token)
 
MessagesetParsedPayload (const std::string &payload)
 
MessagesetParsedPayloadInPayload (const std::string &payload)
 
MessagesetWindowIdInPayload (const std::string &windowId)
 
MessageaddPayload ()
 
MessagesetPayload (rapidjson::Value &&payload)
 
auto alloc () -> decltype(mDocument.GetAllocator())
 
std::string get ()
 
rapidjson::Value && getValue ()
 
- Public Member Functions inherited from alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::MessageInterface
 MessageInterface (const int version, const std::string &nameSpace, const std::string &name)
 

Additional Inherited Members

- Protected Attributes inherited from alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::MessageInterface
rapidjson::Document mDocument
 
rapidjson::Value mPayload
 

Detailed Description

Helper class to construct a MessageInterface message.

Constructor & Destructor Documentation

◆ Message()

alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::Message ( const std::string &  nameSpace,
const int  version,
const std::string &  name 
)
inline

Constructor

Parameters
namespaceThe namespace from this message
versionThe version from this message
nameThe handler name from this message

Member Function Documentation

◆ addIntegerInPayload()

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::addIntegerInPayload ( const std::string &  name,
const int  value 
)
inline

Add an integer to existing payload

Parameters
nameThe name of the new member
valueThe value of the new member
Returns
this

◆ addMember() [1/2]

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::addMember ( const std::string &  name,
const std::string &  value 
)
inline

Add a new member to the json

Parameters
nameThe name of the new member
valueThe value of the new member
Returns
this

◆ addMember() [2/2]

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::addMember ( const std::string &  name,
unsigned  value 
)
inline

Add a new member to the json

Parameters
nameThe name of the new member
valueThe value of the new member
Returns
this

◆ addMemberInPayload() [1/2]

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::addMemberInPayload ( const std::string &  name,
const std::string &  value 
)
inline

Add a new member to existing payload

Parameters
nameThe name of the new member
valueThe value of the new member
Returns
this

◆ addMemberInPayload() [2/2]

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::addMemberInPayload ( const std::string &  name,
unsigned  value 
)
inline

Add a new member to the existing payload

Parameters
nameThe name of the new member
valueThe value of the new member
Returns
this

◆ addPayload()

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::addPayload ( )
inline

Add the payload to this message

Returns
this

◆ alloc()

auto alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::alloc ( ) -> decltype(mDocument.GetAllocator())
inline

Retrieves the rapidjson allocator

Returns
The allocator

◆ get()

std::string alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::get ( )
inlinevirtual

Retrieves the json string representing this message

Returns
json string representation of message

Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::MessageInterface.

◆ getValue()

rapidjson::Value&& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::getValue ( )
inlinevirtual

Retrieves the rapidjson::Value object representation of this message

Returns
rapidjson::Value object representation of message

Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::MessageInterface.

◆ setEnabledInPayload()

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::setEnabledInPayload ( bool  enabled)
inline

Sets the json enabled for this message

Parameters
enabledThe enabled bool to send
Returns
this

◆ setParsedPayload()

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::setParsedPayload ( const std::string &  payload)
inline

Sets the json payload for this message

Parameters
payloadThe payload to parse and send
Returns
this

◆ setParsedPayloadInPayload()

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::setParsedPayloadInPayload ( const std::string &  payload)
inline

Sets the json payload for this message

Parameters
payloadThe payload to parse and send
Returns
this

◆ setPayload()

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::setPayload ( rapidjson::Value &&  payload)
inline

Sets the json payload for this message

Parameters
payloadThe payload to send
Returns
this

◆ setStateInPayload()

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::setStateInPayload ( const std::string &  state)
inline

Sets the json state for this message

Parameters
stateThe state to send
Returns
this

◆ setTokenInPayload() [1/2]

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::setTokenInPayload ( const std::string &  token)
inline

Sets the token for this message

Parameters
token
Returns
this

◆ setTokenInPayload() [2/2]

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::setTokenInPayload ( unsigned  token)
inline

Sets the token for this message

Parameters
token
Returns
this

◆ setWindowIdInPayload()

Message& alexaClientSDK::sampleApplications::ipcServerSampleApp::messages::Message::setWindowIdInPayload ( const std::string &  windowId)
inline

Sets the windowId for this message

Parameters
windowIdThe target windowId of
Returns
this

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

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0