AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
AlarmVolumeRampTypes.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_SETTINGS_INCLUDE_SETTINGS_TYPES_ALARMVOLUMERAMPTYPES_H__
17 #define ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_TYPES_ALARMVOLUMERAMPTYPES_H__
18 
19 #include <istream>
20 #include <ostream>
21 #include <string>
22 
23 namespace alexaClientSDK {
24 namespace settings {
25 namespace types {
26 
32  NONE,
33 
35  ASCENDING
36 };
37 
45 }
46 
53 constexpr bool isEnabled(AlarmVolumeRampTypes volumeRamp) {
54  return volumeRamp != AlarmVolumeRampTypes::NONE;
55 }
56 
63 constexpr AlarmVolumeRampTypes toAlarmRamp(bool enabled) {
65 }
66 
74 inline std::ostream& operator<<(std::ostream& stream, const AlarmVolumeRampTypes& value) {
75  switch (value) {
77  stream << "NONE";
78  return stream;
80  stream << "ASCENDING";
81  return stream;
82  }
83 
84  stream.setstate(std::ios_base::failbit);
85  return stream;
86 }
87 
95 inline std::istream& operator>>(std::istream& is, AlarmVolumeRampTypes& value) {
96  std::string str;
97  is >> str;
98  if ("NONE" == str) {
100  } else if ("ASCENDING" == str) {
102  } else {
103  is.setstate(std::ios_base::failbit);
104  }
105  return is;
106 }
107 
108 } // namespace types
109 } // namespace settings
110 } // namespace alexaClientSDK
111 
112 #endif // ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_TYPES_ALARMVOLUMERAMPTYPES_H__
AlarmVolumeRampTypes
Definition: AlarmVolumeRampTypes.h:30
constexpr AlarmVolumeRampTypes toAlarmRamp(bool enabled)
Definition: AlarmVolumeRampTypes.h:63
::std::string string
Definition: gtest-port.h:1097
std::istream & operator>>(std::istream &is, AlarmVolumeRampTypes &value)
Definition: AlarmVolumeRampTypes.h:95
constexpr bool isEnabled(AlarmVolumeRampTypes volumeRamp)
Definition: AlarmVolumeRampTypes.h:53
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
constexpr AlarmVolumeRampTypes getAlarmVolumeRampDefault()
Definition: AlarmVolumeRampTypes.h:43
std::ostream & operator<<(std::ostream &stream, const AlarmVolumeRampTypes &value)
Definition: AlarmVolumeRampTypes.h:74

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