1 #ifndef HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_V7_1_TYPES_H
2 #define HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_V7_1_TYPES_H
3 
4 #include <hidl/HidlSupport.h>
5 #include <hidl/MQDescriptor.h>
6 #include <utils/NativeHandle.h>
7 #include <utils/misc.h>
8 
9 namespace android {
10 namespace hardware {
11 namespace audio {
12 namespace V7_1 {
13 
14 // Forward declaration for forward reference support:
15 enum class LatencyMode : int32_t;
16 
17 /**
18  * Latency modes used for the variable latency feature on output streams.
19  * Used by setLatencyMode() and getRecommendedLatencyModes() methods.
20  */
21 enum class LatencyMode : int32_t {
22     /**
23      * No specific constraint on the latency
24      */
25     FREE = 0,
26     /**
27      * A relatively low latency compatible with head tracking operation (e.g less than 100ms)
28      */
29     LOW = 1,
30 };
31 
32 //
33 // type declarations for package
34 //
35 
36 template<typename>
37 static inline std::string toString(int32_t o);
38 static inline std::string toString(::android::hardware::audio::V7_1::LatencyMode o);
39 static inline void PrintTo(::android::hardware::audio::V7_1::LatencyMode o, ::std::ostream* os);
40 constexpr int32_t operator|(const ::android::hardware::audio::V7_1::LatencyMode lhs, const ::android::hardware::audio::V7_1::LatencyMode rhs) {
41     return static_cast<int32_t>(static_cast<int32_t>(lhs) | static_cast<int32_t>(rhs));
42 }
43 constexpr int32_t operator|(const int32_t lhs, const ::android::hardware::audio::V7_1::LatencyMode rhs) {
44     return static_cast<int32_t>(lhs | static_cast<int32_t>(rhs));
45 }
46 constexpr int32_t operator|(const ::android::hardware::audio::V7_1::LatencyMode lhs, const int32_t rhs) {
47     return static_cast<int32_t>(static_cast<int32_t>(lhs) | rhs);
48 }
49 constexpr int32_t operator&(const ::android::hardware::audio::V7_1::LatencyMode lhs, const ::android::hardware::audio::V7_1::LatencyMode rhs) {
50     return static_cast<int32_t>(static_cast<int32_t>(lhs) & static_cast<int32_t>(rhs));
51 }
52 constexpr int32_t operator&(const int32_t lhs, const ::android::hardware::audio::V7_1::LatencyMode rhs) {
53     return static_cast<int32_t>(lhs & static_cast<int32_t>(rhs));
54 }
55 constexpr int32_t operator&(const ::android::hardware::audio::V7_1::LatencyMode lhs, const int32_t rhs) {
56     return static_cast<int32_t>(static_cast<int32_t>(lhs) & rhs);
57 }
58 constexpr int32_t &operator|=(int32_t& v, const ::android::hardware::audio::V7_1::LatencyMode e) {
59     v |= static_cast<int32_t>(e);
60     return v;
61 }
62 constexpr int32_t &operator&=(int32_t& v, const ::android::hardware::audio::V7_1::LatencyMode e) {
63     v &= static_cast<int32_t>(e);
64     return v;
65 }
66 
67 //
68 // type header definitions for package
69 //
70 
71 template<>
72 inline std::string toString<::android::hardware::audio::V7_1::LatencyMode>(int32_t o) {
73     using ::android::hardware::details::toHexString;
74     std::string os;
75     ::android::hardware::hidl_bitfield<::android::hardware::audio::V7_1::LatencyMode> flipped = 0;
76     bool first = true;
77     if ((o & ::android::hardware::audio::V7_1::LatencyMode::FREE) == static_cast<int32_t>(::android::hardware::audio::V7_1::LatencyMode::FREE)) {
78         os += (first ? "" : " | ");
79         os += "FREE";
80         first = false;
81         flipped |= ::android::hardware::audio::V7_1::LatencyMode::FREE;
82     }
83     if ((o & ::android::hardware::audio::V7_1::LatencyMode::LOW) == static_cast<int32_t>(::android::hardware::audio::V7_1::LatencyMode::LOW)) {
84         os += (first ? "" : " | ");
85         os += "LOW";
86         first = false;
87         flipped |= ::android::hardware::audio::V7_1::LatencyMode::LOW;
88     }
89     if (o != flipped) {
90         os += (first ? "" : " | ");
91         os += toHexString(o & (~flipped));
92     }os += " (";
93     os += toHexString(o);
94     os += ")";
95     return os;
96 }
97 
toString(::android::hardware::audio::V7_1::LatencyMode o)98 static inline std::string toString(::android::hardware::audio::V7_1::LatencyMode o) {
99     using ::android::hardware::details::toHexString;
100     if (o == ::android::hardware::audio::V7_1::LatencyMode::FREE) {
101         return "FREE";
102     }
103     if (o == ::android::hardware::audio::V7_1::LatencyMode::LOW) {
104         return "LOW";
105     }
106     std::string os;
107     os += toHexString(static_cast<int32_t>(o));
108     return os;
109 }
110 
PrintTo(::android::hardware::audio::V7_1::LatencyMode o,::std::ostream * os)111 static inline void PrintTo(::android::hardware::audio::V7_1::LatencyMode o, ::std::ostream* os) {
112     *os << toString(o);
113 }
114 
115 
116 }  // namespace V7_1
117 }  // namespace audio
118 }  // namespace hardware
119 }  // namespace android
120 
121 //
122 // global type declarations for package
123 //
124 
125 namespace android {
126 namespace hardware {
127 namespace details {
128 #pragma clang diagnostic push
129 #pragma clang diagnostic ignored "-Wc++17-extensions"
130 template<> inline constexpr std::array<::android::hardware::audio::V7_1::LatencyMode, 2> hidl_enum_values<::android::hardware::audio::V7_1::LatencyMode> = {
131     ::android::hardware::audio::V7_1::LatencyMode::FREE,
132     ::android::hardware::audio::V7_1::LatencyMode::LOW,
133 };
134 #pragma clang diagnostic pop
135 }  // namespace details
136 }  // namespace hardware
137 }  // namespace android
138 
139 
140 #endif  // HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_V7_1_TYPES_H
141