AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
AuthObserver.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 ALEXA_CLIENT_SDK_INTEGRATION_INCLUDE_INTEGRATION_AUTHOBSERVER_H_
17 #define ALEXA_CLIENT_SDK_INTEGRATION_INCLUDE_INTEGRATION_AUTHOBSERVER_H_
18 
19 #include <chrono>
20 #include <condition_variable>
21 #include <mutex>
22 
24 
25 namespace alexaClientSDK {
26 namespace integration {
27 
29 public:
30  AuthObserver();
31  void onAuthStateChange(
36  bool waitFor(
38  const std::chrono::seconds = std::chrono::seconds(20));
39 
40 private:
43  std::mutex m_mutex;
44  std::condition_variable m_wakeTrigger;
45 };
46 
47 } // namespace integration
48 } // namespace alexaClientSDK
49 
50 #endif // ALEXA_CLIENT_SDK_INTEGRATION_INCLUDE_INTEGRATION_AUTHOBSERVER_H_
alexaClientSDK::integration::AuthObserver::getAuthState
AuthObserverInterface::State getAuthState() const
Definition: AuthObserver.cpp:37
alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface::Error
Error
The enum Error encodes possible errors which may occur when changing state.
Definition: AuthObserverInterface.h:48
alexaClientSDK::integration::AuthObserver::AuthObserver
AuthObserver()
Definition: AuthObserver.cpp:24
alexaClientSDK::integration::AuthObserver::waitFor
bool waitFor(const avsCommon::sdkInterfaces::AuthObserverInterface::State, const std::chrono::seconds=std::chrono::seconds(20))
Definition: AuthObserver.cpp:41
alexaClientSDK
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface::Error::SUCCESS
@ SUCCESS
Success.
alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface
Definition: AuthObserverInterface.h:31
alexaClientSDK::integration::AuthObserver::onAuthStateChange
void onAuthStateChange(const avsCommon::sdkInterfaces::AuthObserverInterface::State, const avsCommon::sdkInterfaces::AuthObserverInterface::Error=avsCommon::sdkInterfaces::AuthObserverInterface::Error::SUCCESS) override
Definition: AuthObserver.cpp:29
alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface::State
State
The enum State describes the state of authorization.
Definition: AuthObserverInterface.h:34
AuthObserverInterface.h
alexaClientSDK::integration::AuthObserver
Definition: AuthObserver.h:28

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