AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
DefaultEndpointRangeControllerHandler.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ACSDK_SAMPLE_ENDPOINT_DEFAULTENDPOINT_DEFAULTENDPOINTRANGECONTROLLERHANDLER_H_
17 #define ACSDK_SAMPLE_ENDPOINT_DEFAULTENDPOINT_DEFAULTENDPOINTRANGECONTROLLERHANDLER_H_
18 
19 #include <list>
20 
23 
24 namespace alexaClientSDK {
25 namespace sampleApplications {
26 namespace common {
27 
33 public:
40  static std::shared_ptr<DefaultEndpointRangeControllerHandler> create(const std::string& instance);
41 
45  override;
46  std::pair<avsCommon::avs::AlexaResponseType, std::string> setRangeValue(
47  double value,
49  std::pair<avsCommon::avs::AlexaResponseType, std::string> adjustRangeValue(
50  double value,
52  std::pair<
55  getRangeState() override;
56  bool addObserver(
57  std::shared_ptr<avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface> observer) override;
58  void removeObserver(
59  const std::shared_ptr<avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface>& observer)
60  override;
62 
63 private:
70 
72  std::string m_instance;
73 
75  double m_currentRangeValue;
76 
78  double m_maximumRangeValue;
79 
81  double m_minmumRangeValue;
82 
84  double m_precision;
85 
87  std::mutex m_mutex;
88 
90  std::list<std::shared_ptr<avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface>> m_observers;
91 };
92 
93 } // namespace common
94 } // namespace sampleApplications
95 } // namespace alexaClientSDK
96 
97 #endif // ACSDK_SAMPLE_ENDPOINT_DEFAULTENDPOINT_DEFAULTENDPOINTRANGECONTROLLERHANDLER_H_
std::pair< avsCommon::avs::AlexaResponseType, std::string > adjustRangeValue(double value, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
void removeObserver(const std::shared_ptr< avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface > &observer) override
AlexaResponseType
Definition: AlexaResponseType.h:30
::std::string string
Definition: gtest-port.h:1097
std::pair< avsCommon::avs::AlexaResponseType, std::string > setRangeValue(double value, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
AlexaStateChangeCauseType
Definition: AlexaStateChangeCauseType.h:28
Definition: DefaultEndpointRangeControllerHandler.h:31
Definition: common.py:1
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
bool addObserver(std::shared_ptr< avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface > observer) override
static std::shared_ptr< DefaultEndpointRangeControllerHandler > create(const std::string &instance)
avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::RangeControllerConfiguration getConfiguration() override
std::pair< avsCommon::avs::AlexaResponseType, avsCommon::utils::Optional< avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::RangeState > > getRangeState() override

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