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

#include <IPCHandlerBase.h>

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

Public Types

using IPCMessageHandler = std::function< void(const std::string &)>
 Alias for the message handler function. More...
 

Public Member Functions

void invokeMethod (const std::string &methodName, const std::string &message)
 
 ~IPCHandlerBase ()
 

Protected Member Functions

 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

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 Base class to assist IPC components to handle messages coming from IPC client.

Member Typedef Documentation

◆ IPCMessageHandler

Alias for the message handler function.

Constructor & Destructor Documentation

◆ ~IPCHandlerBase()

alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::IPCHandlerBase::~IPCHandlerBase ( )

Destructor.

◆ IPCHandlerBase()

alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::IPCHandlerBase::IPCHandlerBase ( const std::string &  namespaceName,
std::shared_ptr< alexaClientSDK::avsCommon::utils::threading::Executor executor 
)
protected

Base IPC handler constructor. Note: We do not expect this class to be instantiated on its own.

Parameters
namespaceNameNamespace of the realized IPC handler class.
executorExecutor context to support operations asynchronously.

Member Function Documentation

◆ deregisterIPCMessageHandlerMethod()

bool alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::IPCHandlerBase::deregisterIPCMessageHandlerMethod ( const std::string &  methodName)
protected

De-registers the method that handles an IPC message.

Parameters
methodNameName of the IPC method for which handler has to be registered.
Returns
true is successful.

◆ invokeMethod()

void alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::IPCHandlerBase::invokeMethod ( const std::string &  methodName,
const std::string &  message 
)

Invokes a method to handle an IPC message.

Parameters
methodNameName of the method to be invoked.
messageMessage to be handled by a concrete method.

◆ registerIPCMessageHandlerMethod()

bool alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::IPCHandlerBase::registerIPCMessageHandlerMethod ( const std::string &  methodName,
IPCMessageHandler  handlerFunction 
)
protected

Registers the method that handles an IPC message.

Parameters
methodNameName of the IPC method for which handler has to be registered.
handlerFunctionFunction reference to be invoked for the said method.
Returns
true is successful.

Member Data Documentation

◆ m_executor

std::shared_ptr<alexaClientSDK::avsCommon::utils::threading::Executor> alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::IPCHandlerBase::m_executor
protected

Executor context to support operations asynchronously.

◆ m_messageHandlers

std::unordered_map<std::string, IPCMessageHandler> alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::IPCHandlerBase::m_messageHandlers
protected

Dictionary to hold the IPC message handler methods.

◆ m_namespaceName

std::string alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::IPCHandlerBase::m_namespaceName
protected

Name of the namespace of the realized IPC handler class.


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