1 /*
2 * This file is auto-generated. DO NOT MODIFY.
3 * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation --structured --version 6 --hash notfrozen -t --stability vintf --min_sdk_version current -pout/soong/.intermediates/hardware/interfaces/common/fmq/aidl/android.hardware.common.fmq_interface/1/preprocessed.aidl -pout/soong/.intermediates/hardware/interfaces/common/aidl/android.hardware.common_interface/2/preprocessed.aidl --previous_api_dir=hardware/interfaces/power/aidl/aidl_api/android.hardware.power/5 --previous_hash d111735ed2b89b6c32443aac9b162b1afbbea3f2 --ninja -d out/soong/.intermediates/hardware/interfaces/power/aidl/android.hardware.power-V6-ndk-source/gen/staging/android/hardware/power/ChannelMessage.cpp.d -h out/soong/.intermediates/hardware/interfaces/power/aidl/android.hardware.power-V6-ndk-source/gen/include/staging -o out/soong/.intermediates/hardware/interfaces/power/aidl/android.hardware.power-V6-ndk-source/gen/staging -Nhardware/interfaces/power/aidl hardware/interfaces/power/aidl/android/hardware/power/ChannelMessage.aidl
4 *
5 * DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
6 * ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
7 * AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
8 */
9 #pragma once
10
11 #include <array>
12 #include <cassert>
13 #include <cstdint>
14 #include <memory>
15 #include <optional>
16 #include <string>
17 #include <tuple>
18 #include <type_traits>
19 #include <utility>
20 #include <variant>
21 #include <vector>
22 #include <android/binder_enums.h>
23 #include <android/binder_interface_utils.h>
24 #include <android/binder_parcelable_utils.h>
25 #include <android/binder_to_string.h>
26 #include <aidl/android/hardware/power/ChannelMessage.h>
27 #include <aidl/android/hardware/power/SessionHint.h>
28 #include <aidl/android/hardware/power/SessionMode.h>
29 #include <aidl/android/hardware/power/WorkDurationFixedV1.h>
30 #ifdef BINDER_STABILITY_SUPPORT
31 #include <android/binder_stability.h>
32 #endif // BINDER_STABILITY_SUPPORT
33
34 #ifndef __BIONIC__
35 #define __assert2(a,b,c,d) ((void)0)
36 #endif
37
38 namespace aidl::android::hardware::power {
39 class WorkDurationFixedV1;
40 } // namespace aidl::android::hardware::power
41 namespace aidl {
42 namespace android {
43 namespace hardware {
44 namespace power {
45 class ChannelMessage {
46 public:
47 typedef std::true_type fixed_size;
48 static const char* descriptor;
49
50 class ChannelMessageContents {
51 public:
52 typedef std::true_type fixed_size;
53 static const char* descriptor;
54
55 class SessionModeSetter {
56 public:
57 typedef std::true_type fixed_size;
58 static const char* descriptor;
59
60 ::aidl::android::hardware::power::SessionMode modeInt __attribute__((aligned (4))) = ::aidl::android::hardware::power::SessionMode(0);
61 bool enabled __attribute__((aligned (1))) = false;
62
63 binder_status_t readFromParcel(const AParcel* parcel);
64 binder_status_t writeToParcel(AParcel* parcel) const;
65
66 inline bool operator==(const SessionModeSetter& _rhs) const {
67 return std::tie(modeInt, enabled) == std::tie(_rhs.modeInt, _rhs.enabled);
68 }
69 inline bool operator<(const SessionModeSetter& _rhs) const {
70 return std::tie(modeInt, enabled) < std::tie(_rhs.modeInt, _rhs.enabled);
71 }
72 inline bool operator!=(const SessionModeSetter& _rhs) const {
73 return !(*this == _rhs);
74 }
75 inline bool operator>(const SessionModeSetter& _rhs) const {
76 return _rhs < *this;
77 }
78 inline bool operator>=(const SessionModeSetter& _rhs) const {
79 return !(*this < _rhs);
80 }
81 inline bool operator<=(const SessionModeSetter& _rhs) const {
82 return !(_rhs < *this);
83 }
84
85 static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()86 inline std::string toString() const {
87 std::ostringstream _aidl_os;
88 _aidl_os << "SessionModeSetter{";
89 _aidl_os << "modeInt: " << ::android::internal::ToString(modeInt);
90 _aidl_os << ", enabled: " << ::android::internal::ToString(enabled);
91 _aidl_os << "}";
92 return _aidl_os.str();
93 }
94 };
95 static_assert(offsetof(SessionModeSetter, modeInt) == 0);
96 static_assert(sizeof(::aidl::android::hardware::power::SessionMode) == 4);
97 static_assert(offsetof(SessionModeSetter, enabled) == 4);
98 static_assert(sizeof(bool) == 1);
99 static_assert(alignof(SessionModeSetter) == 4);
100 static_assert(sizeof(SessionModeSetter) == 8);
101 enum class Tag : int8_t {
102 reserved = 0,
103 targetDuration = 1,
104 hint = 2,
105 mode = 3,
106 workDuration = 4,
107 };
108
109 // Expose tag symbols for legacy code
110 static const inline Tag reserved = Tag::reserved;
111 static const inline Tag targetDuration = Tag::targetDuration;
112 static const inline Tag hint = Tag::hint;
113 static const inline Tag mode = Tag::mode;
114 static const inline Tag workDuration = Tag::workDuration;
115
116 template <Tag _Tag>
117 using _at = typename std::tuple_element<static_cast<size_t>(_Tag), std::tuple<std::array<int64_t, 16>, int64_t, ::aidl::android::hardware::power::SessionHint, ::aidl::android::hardware::power::ChannelMessage::ChannelMessageContents::SessionModeSetter, ::aidl::android::hardware::power::WorkDurationFixedV1>>::type;
118 template <Tag _Tag, typename _Type>
make(_Type && _arg)119 static ChannelMessageContents make(_Type&& _arg) {
120 ChannelMessageContents _inst;
121 _inst.set<_Tag>(std::forward<_Type>(_arg));
122 return _inst;
123 }
getTag()124 constexpr Tag getTag() const {
125 return _tag;
126 }
127 template <Tag _Tag>
get()128 const _at<_Tag>& get() const {
129 if (_Tag != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
130 return *(_at<_Tag>*)(&_value);
131 }
132 template <Tag _Tag>
get()133 _at<_Tag>& get() {
134 if (_Tag != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
135 return *(_at<_Tag>*)(&_value);
136 }
137 template <Tag _Tag, typename _Type>
set(_Type && _arg)138 void set(_Type&& _arg) {
139 _tag = _Tag;
140 get<_Tag>() = std::forward<_Type>(_arg);
141 }
142 binder_status_t readFromParcel(const AParcel* _parcel);
143 binder_status_t writeToParcel(AParcel* _parcel) const;
144
_cmp(const ChannelMessageContents & _lhs,const ChannelMessageContents & _rhs)145 static int _cmp(const ChannelMessageContents& _lhs, const ChannelMessageContents& _rhs) {
146 return _cmp_value(_lhs.getTag(), _rhs.getTag()) || _cmp_value_at<workDuration>(_lhs, _rhs);
147 }
148 template <Tag _Tag>
_cmp_value_at(const ChannelMessageContents & _lhs,const ChannelMessageContents & _rhs)149 static int _cmp_value_at(const ChannelMessageContents& _lhs, const ChannelMessageContents& _rhs) {
150 if constexpr (_Tag == reserved) {
151 return _cmp_value(_lhs.get<_Tag>(), _rhs.get<_Tag>());
152 } else {
153 return (_lhs.getTag() == _Tag)
154 ? _cmp_value(_lhs.get<_Tag>(), _rhs.get<_Tag>())
155 : _cmp_value_at<static_cast<Tag>(static_cast<size_t>(_Tag)-1)>(_lhs, _rhs);
156 }
157 }
158 template <typename _Type>
_cmp_value(const _Type & _lhs,const _Type & _rhs)159 static int _cmp_value(const _Type& _lhs, const _Type& _rhs) {
160 return (_lhs == _rhs) ? 0 : (_lhs < _rhs) ? -1 : 1;
161 }
162 inline bool operator!=(const ChannelMessageContents&_rhs) const {
163 return _cmp(*this, _rhs) != 0;
164 }
165 inline bool operator<(const ChannelMessageContents&_rhs) const {
166 return _cmp(*this, _rhs) < 0;
167 }
168 inline bool operator<=(const ChannelMessageContents&_rhs) const {
169 return _cmp(*this, _rhs) <= 0;
170 }
171 inline bool operator==(const ChannelMessageContents&_rhs) const {
172 return _cmp(*this, _rhs) == 0;
173 }
174 inline bool operator>(const ChannelMessageContents&_rhs) const {
175 return _cmp(*this, _rhs) > 0;
176 }
177 inline bool operator>=(const ChannelMessageContents&_rhs) const {
178 return _cmp(*this, _rhs) >= 0;
179 }
180 static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()181 inline std::string toString() const {
182 std::ostringstream os;
183 os << "ChannelMessageContents{";
184 switch (getTag()) {
185 case reserved: os << "reserved: " << ::android::internal::ToString(get<reserved>()); break;
186 case targetDuration: os << "targetDuration: " << ::android::internal::ToString(get<targetDuration>()); break;
187 case hint: os << "hint: " << ::android::internal::ToString(get<hint>()); break;
188 case mode: os << "mode: " << ::android::internal::ToString(get<mode>()); break;
189 case workDuration: os << "workDuration: " << ::android::internal::ToString(get<workDuration>()); break;
190 }
191 os << "}";
192 return os.str();
193 }
194 private:
195 Tag _tag = reserved;
196 union _value_t {
_value_t()197 _value_t() {}
~_value_t()198 ~_value_t() {}
199 std::array<int64_t, 16> reserved __attribute__((aligned (8))) = std::array<int64_t, 16>({{0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L}});
200 int64_t targetDuration __attribute__((aligned (8)));
201 ::aidl::android::hardware::power::SessionHint hint __attribute__((aligned (4)));
202 ::aidl::android::hardware::power::ChannelMessage::ChannelMessageContents::SessionModeSetter mode __attribute__((aligned (4)));
203 ::aidl::android::hardware::power::WorkDurationFixedV1 workDuration __attribute__((aligned (8)));
204 } _value;
205 };
206 static_assert(sizeof(std::array<int64_t, 16>) == 128);
207 static_assert(sizeof(int64_t) == 8);
208 static_assert(sizeof(::aidl::android::hardware::power::SessionHint) == 4);
209 static_assert(sizeof(::aidl::android::hardware::power::ChannelMessage::ChannelMessageContents::SessionModeSetter) == 8);
210 static_assert(sizeof(::aidl::android::hardware::power::WorkDurationFixedV1) == 32);
211 static_assert(alignof(ChannelMessageContents) == 8);
212 static_assert(sizeof(ChannelMessageContents) == 136);
213 int32_t sessionID __attribute__((aligned (4))) = 0;
214 int64_t timeStampNanos __attribute__((aligned (8))) = 0L;
215 ::aidl::android::hardware::power::ChannelMessage::ChannelMessageContents data __attribute__((aligned (8)));
216
217 binder_status_t readFromParcel(const AParcel* parcel);
218 binder_status_t writeToParcel(AParcel* parcel) const;
219
220 inline bool operator==(const ChannelMessage& _rhs) const {
221 return std::tie(sessionID, timeStampNanos, data) == std::tie(_rhs.sessionID, _rhs.timeStampNanos, _rhs.data);
222 }
223 inline bool operator<(const ChannelMessage& _rhs) const {
224 return std::tie(sessionID, timeStampNanos, data) < std::tie(_rhs.sessionID, _rhs.timeStampNanos, _rhs.data);
225 }
226 inline bool operator!=(const ChannelMessage& _rhs) const {
227 return !(*this == _rhs);
228 }
229 inline bool operator>(const ChannelMessage& _rhs) const {
230 return _rhs < *this;
231 }
232 inline bool operator>=(const ChannelMessage& _rhs) const {
233 return !(*this < _rhs);
234 }
235 inline bool operator<=(const ChannelMessage& _rhs) const {
236 return !(_rhs < *this);
237 }
238
239 static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()240 inline std::string toString() const {
241 std::ostringstream _aidl_os;
242 _aidl_os << "ChannelMessage{";
243 _aidl_os << "sessionID: " << ::android::internal::ToString(sessionID);
244 _aidl_os << ", timeStampNanos: " << ::android::internal::ToString(timeStampNanos);
245 _aidl_os << ", data: " << ::android::internal::ToString(data);
246 _aidl_os << "}";
247 return _aidl_os.str();
248 }
249 };
250 static_assert(offsetof(ChannelMessage, sessionID) == 0);
251 static_assert(sizeof(int32_t) == 4);
252 static_assert(offsetof(ChannelMessage, timeStampNanos) == 8);
253 static_assert(sizeof(int64_t) == 8);
254 static_assert(offsetof(ChannelMessage, data) == 16);
255 static_assert(sizeof(::aidl::android::hardware::power::ChannelMessage::ChannelMessageContents) == 136);
256 static_assert(alignof(ChannelMessage) == 8);
257 static_assert(sizeof(ChannelMessage) == 152);
258 } // namespace power
259 } // namespace hardware
260 } // namespace android
261 } // namespace aidl
262 namespace aidl {
263 namespace android {
264 namespace hardware {
265 namespace power {
toString(ChannelMessage::ChannelMessageContents::Tag val)266 [[nodiscard]] static inline std::string toString(ChannelMessage::ChannelMessageContents::Tag val) {
267 switch(val) {
268 case ChannelMessage::ChannelMessageContents::Tag::reserved:
269 return "reserved";
270 case ChannelMessage::ChannelMessageContents::Tag::targetDuration:
271 return "targetDuration";
272 case ChannelMessage::ChannelMessageContents::Tag::hint:
273 return "hint";
274 case ChannelMessage::ChannelMessageContents::Tag::mode:
275 return "mode";
276 case ChannelMessage::ChannelMessageContents::Tag::workDuration:
277 return "workDuration";
278 default:
279 return std::to_string(static_cast<int8_t>(val));
280 }
281 }
282 } // namespace power
283 } // namespace hardware
284 } // namespace android
285 } // namespace aidl
286 namespace ndk {
287 namespace internal {
288 #pragma clang diagnostic push
289 #pragma clang diagnostic ignored "-Wc++17-extensions"
290 template <>
291 constexpr inline std::array<aidl::android::hardware::power::ChannelMessage::ChannelMessageContents::Tag, 5> enum_values<aidl::android::hardware::power::ChannelMessage::ChannelMessageContents::Tag> = {
292 aidl::android::hardware::power::ChannelMessage::ChannelMessageContents::Tag::reserved,
293 aidl::android::hardware::power::ChannelMessage::ChannelMessageContents::Tag::targetDuration,
294 aidl::android::hardware::power::ChannelMessage::ChannelMessageContents::Tag::hint,
295 aidl::android::hardware::power::ChannelMessage::ChannelMessageContents::Tag::mode,
296 aidl::android::hardware::power::ChannelMessage::ChannelMessageContents::Tag::workDuration,
297 };
298 #pragma clang diagnostic pop
299 } // namespace internal
300 } // namespace ndk
301