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

#include <APLClientHandler.h>

Inheritance diagram for alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandler:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandler:
Collaboration graph
[legend]

Public Member Functions

void dispatchCreateRenderer (const std::string &windowId, const std::string &token)
 
void dispatchSendMessageToViewhost (const std::string &windowId, const std::string &payload)
 
void registerHandlers ()
 Register this handler for its namespace and its methods for the corresponding namespace functions. More...
 
RequiresShutdown Functions
void doShutdown () override
 
- Public Member Functions inherited from alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::IPCHandlerBase
void invokeMethod (const std::string &methodName, const std::string &message)
 
 ~IPCHandlerBase ()
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::RequiresShutdown
 RequiresShutdown (const std::string &name)
 
virtual ~RequiresShutdown ()
 Destructor. More...
 
const std::string & name () const
 
void shutdown ()
 
bool isShutdown () const
 

Static Public Member Functions

static std::shared_ptr< APLClientHandlercreate (std::shared_ptr< IPCHandlerRegistrationInterface > ipcHandlerRegistrar, std::shared_ptr< APLClientHandlerInterface > aplClientComponent)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::IPCHandlerBase
using IPCMessageHandler = std::function< void(const std::string &)>
 Alias for the message handler function. More...
 
- Protected Member Functions inherited from alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::IPCHandlerBase
 IPCHandlerBase (const std::string &namespaceName, std::shared_ptr< alexaClientSDK::avsCommon::utils::threading::Executor > executor)
 
bool registerIPCMessageHandlerMethod (const std::string &methodName, IPCMessageHandler handlerFunction)
 
bool deregisterIPCMessageHandlerMethod (const std::string &methodName)
 
- Protected Attributes inherited from alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::IPCHandlerBase
std::string m_namespaceName
 Name of the namespace of the realized IPC handler class. More...
 
std::unordered_map< std::string, IPCMessageHandlerm_messageHandlers
 Dictionary to hold the IPC message handler methods. More...
 
std::shared_ptr< alexaClientSDK::avsCommon::utils::threading::Executorm_executor
 Executor context to support operations asynchronously. More...
 

Detailed Description

A contract for the handler that will handle the APLClient namespace messages coming from the IPC client.

Member Function Documentation

◆ create()

static std::shared_ptr<APLClientHandler> alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandler::create ( std::shared_ptr< IPCHandlerRegistrationInterface ipcHandlerRegistrar,
std::shared_ptr< APLClientHandlerInterface aplClientComponent 
)
static

Create an instance of APLClientHandler

Parameters
ipcHandlerRegistrarUsed to register APLClientHandler.
aplClientComponentHandles the parsed APLClient payloads.
Returns
Shared pointer to APLClientHandler

◆ dispatchCreateRenderer()

void alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandler::dispatchCreateRenderer ( const std::string &  windowId,
const std::string &  token 
)

Sends a createRenderer IPC message to the IPC client.

Parameters
windowIdIdentifies which window to render the specified APL document.
tokenUnique identifier for the APL document.

◆ dispatchSendMessageToViewhost()

void alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandler::dispatchSendMessageToViewhost ( const std::string &  windowId,
const std::string &  payload 
)

Sends a sendMessageToViewhost IPC message to the IPC client.

Parameters
windowIdIdentifies the APL window/document instance for which the APL core message is intended.
payloadOpaque serialized APL Core message payload to be provided to the IPC APL Viewhost.

◆ doShutdown()

void alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandler::doShutdown ( )
overridevirtual

Prepares/enables this object to be deleted. This should be the last function called on this object prior to deleting (or resetting) its shared_ptr.

Warning
  • Attempting to call functions on this object after calling shutdown() can result in undefined behavior.
  • Neglecting to call shutdown() on this object can result in resource leaks or other undefined behavior.

Implements alexaClientSDK::avsCommon::utils::RequiresShutdown.

◆ registerHandlers()

void alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandler::registerHandlers ( )

Register this handler for its namespace and its methods for the corresponding namespace functions.


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