AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
RendererObserverInterface.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 ACSDKALERTS_RENDERER_RENDEREROBSERVERINTERFACE_H_
17 #define ACSDKALERTS_RENDERER_RENDEREROBSERVERINTERFACE_H_
18 
19 #include <string>
20 
21 namespace alexaClientSDK {
22 namespace acsdkAlerts {
23 namespace renderer {
24 
29 public:
33  enum class State {
35  UNSET,
37  STARTED,
39  STOPPED,
41  COMPLETED,
43  ERROR
44  };
45 
49  virtual ~RendererObserverInterface() = default;
50 
57  virtual void onRendererStateChange(State state, const std::string& reason = "") = 0;
58 
65  static std::string stateToString(State state);
66 };
67 
69  switch (state) {
70  case State::UNSET:
71  return "UNSET";
72  case State::STARTED:
73  return "STARTED";
74  case State::STOPPED:
75  return "STOPPED";
76  case State::COMPLETED:
77  return "COMPLETED";
78  case State::ERROR:
79  return "ERROR";
80  }
81  return "unknown State";
82 }
83 
91 inline std::ostream& operator<<(std::ostream& stream, const RendererObserverInterface::State& state) {
92  return stream << RendererObserverInterface::stateToString(state);
93 }
94 
95 } // namespace renderer
96 } // namespace acsdkAlerts
97 } // namespace alexaClientSDK
98 
99 #endif // ACSDKALERTS_RENDERER_RENDEREROBSERVERINTERFACE_H_
::std::string string
Definition: gtest-port.h:1097
static std::string stateToString(State state)
Definition: RendererObserverInterface.h:68
The renderer has completed rendering, if the renderer was initiated with a finite loop count...
virtual void onRendererStateChange(State state, const std::string &reason="")=0
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
The renderer has stopped rendering due to being stopped via a direct api call.
std::ostream & operator<<(std::ostream &stream, const RendererObserverInterface::State &state)
Definition: RendererObserverInterface.h:91

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