1 /*
2  * This file is auto-generated.  DO NOT MODIFY.
3  * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -t --min_sdk_version current --ninja -d out/soong/.intermediates/frameworks/base/core/java/android.os.statsbootstrap_aidl-cpp-source/gen/staging/android/os/StatsBootstrapAtomValue.cpp.d -h out/soong/.intermediates/frameworks/base/core/java/android.os.statsbootstrap_aidl-cpp-source/gen/include/staging -o out/soong/.intermediates/frameworks/base/core/java/android.os.statsbootstrap_aidl-cpp-source/gen/staging -Nframeworks/base/core/java frameworks/base/core/java/android/os/StatsBootstrapAtomValue.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 <android/binder_to_string.h>
12 #include <android/os/StatsBootstrapAtomValue.h>
13 #include <array>
14 #include <binder/Enums.h>
15 #include <binder/Parcel.h>
16 #include <binder/Status.h>
17 #include <cassert>
18 #include <cstdint>
19 #include <string>
20 #include <tuple>
21 #include <type_traits>
22 #include <utility>
23 #include <utils/String16.h>
24 #include <variant>
25 #include <vector>
26 
27 #ifndef __BIONIC__
28 #define __assert2(a,b,c,d) ((void)0)
29 #endif
30 
31 namespace android {
32 namespace os {
33 class LIBBINDER_EXPORTED StatsBootstrapAtomValue : public ::android::Parcelable {
34 public:
35   class LIBBINDER_EXPORTED Primitive : public ::android::Parcelable {
36   public:
37     enum class Tag : int32_t {
38       boolValue = 0,
39       intValue = 1,
40       longValue = 2,
41       floatValue = 3,
42       stringValue = 4,
43       bytesValue = 5,
44       stringArrayValue = 6,
45     };
46     // Expose tag symbols for legacy code
47     static const inline Tag boolValue = Tag::boolValue;
48     static const inline Tag intValue = Tag::intValue;
49     static const inline Tag longValue = Tag::longValue;
50     static const inline Tag floatValue = Tag::floatValue;
51     static const inline Tag stringValue = Tag::stringValue;
52     static const inline Tag bytesValue = Tag::bytesValue;
53     static const inline Tag stringArrayValue = Tag::stringArrayValue;
54 
55     template<typename _Tp>
56     static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Primitive>;
57 
Primitive()58     Primitive() : _value(std::in_place_index<static_cast<size_t>(boolValue)>, bool(false)) { }
59 
60     template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
61     // NOLINTNEXTLINE(google-explicit-constructor)
Primitive(_Tp && _arg)62     constexpr Primitive(_Tp&& _arg)
63         : _value(std::forward<_Tp>(_arg)) {}
64 
65     template <size_t _Np, typename... _Tp>
Primitive(std::in_place_index_t<_Np>,_Tp &&..._args)66     constexpr explicit Primitive(std::in_place_index_t<_Np>, _Tp&&... _args)
67         : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
68 
69     template <Tag _tag, typename... _Tp>
make(_Tp &&..._args)70     static Primitive make(_Tp&&... _args) {
71       return Primitive(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
72     }
73 
74     template <Tag _tag, typename _Tp, typename... _Up>
make(std::initializer_list<_Tp> _il,_Up &&..._args)75     static Primitive make(std::initializer_list<_Tp> _il, _Up&&... _args) {
76       return Primitive(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
77     }
78 
getTag()79     Tag getTag() const {
80       return static_cast<Tag>(_value.index());
81     }
82 
83     template <Tag _tag>
get()84     const auto& get() const {
85       if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
86       return std::get<static_cast<size_t>(_tag)>(_value);
87     }
88 
89     template <Tag _tag>
get()90     auto& get() {
91       if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
92       return std::get<static_cast<size_t>(_tag)>(_value);
93     }
94 
95     template <Tag _tag, typename... _Tp>
set(_Tp &&..._args)96     void set(_Tp&&... _args) {
97       _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
98     }
99 
100     inline bool operator==(const Primitive& _rhs) const {
101       return _value == _rhs._value;
102     }
103     inline bool operator<(const Primitive& _rhs) const {
104       return _value < _rhs._value;
105     }
106     inline bool operator!=(const Primitive& _rhs) const {
107       return !(*this == _rhs);
108     }
109     inline bool operator>(const Primitive& _rhs) const {
110       return _rhs < *this;
111     }
112     inline bool operator>=(const Primitive& _rhs) const {
113       return !(*this < _rhs);
114     }
115     inline bool operator<=(const Primitive& _rhs) const {
116       return !(_rhs < *this);
117     }
118 
119     ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
120     ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
getParcelableDescriptor()121     static const ::android::String16& getParcelableDescriptor() {
122       static const ::android::StaticString16 DESCRIPTOR (u"android.os.StatsBootstrapAtomValue.Primitive");
123       return DESCRIPTOR;
124     }
toString()125     inline std::string toString() const {
126       std::ostringstream os;
127       os << "Primitive{";
128       switch (getTag()) {
129       case boolValue: os << "boolValue: " << ::android::internal::ToString(get<boolValue>()); break;
130       case intValue: os << "intValue: " << ::android::internal::ToString(get<intValue>()); break;
131       case longValue: os << "longValue: " << ::android::internal::ToString(get<longValue>()); break;
132       case floatValue: os << "floatValue: " << ::android::internal::ToString(get<floatValue>()); break;
133       case stringValue: os << "stringValue: " << ::android::internal::ToString(get<stringValue>()); break;
134       case bytesValue: os << "bytesValue: " << ::android::internal::ToString(get<bytesValue>()); break;
135       case stringArrayValue: os << "stringArrayValue: " << ::android::internal::ToString(get<stringArrayValue>()); break;
136       }
137       os << "}";
138       return os.str();
139     }
140   private:
141     std::variant<bool, int32_t, int64_t, float, ::android::String16, ::std::vector<uint8_t>, ::std::vector<::android::String16>> _value;
142   };  // class Primitive
143   class LIBBINDER_EXPORTED Annotation : public ::android::Parcelable {
144   public:
145     enum class Id : int8_t {
146       NONE = 0,
147       IS_UID = 1,
148     };
149     class LIBBINDER_EXPORTED Primitive : public ::android::Parcelable {
150     public:
151       enum class Tag : int32_t {
152         boolValue = 0,
153         intValue = 1,
154       };
155       // Expose tag symbols for legacy code
156       static const inline Tag boolValue = Tag::boolValue;
157       static const inline Tag intValue = Tag::intValue;
158 
159       template<typename _Tp>
160       static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Primitive>;
161 
Primitive()162       Primitive() : _value(std::in_place_index<static_cast<size_t>(boolValue)>, bool(false)) { }
163 
164       template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
165       // NOLINTNEXTLINE(google-explicit-constructor)
Primitive(_Tp && _arg)166       constexpr Primitive(_Tp&& _arg)
167           : _value(std::forward<_Tp>(_arg)) {}
168 
169       template <size_t _Np, typename... _Tp>
Primitive(std::in_place_index_t<_Np>,_Tp &&..._args)170       constexpr explicit Primitive(std::in_place_index_t<_Np>, _Tp&&... _args)
171           : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
172 
173       template <Tag _tag, typename... _Tp>
make(_Tp &&..._args)174       static Primitive make(_Tp&&... _args) {
175         return Primitive(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
176       }
177 
178       template <Tag _tag, typename _Tp, typename... _Up>
make(std::initializer_list<_Tp> _il,_Up &&..._args)179       static Primitive make(std::initializer_list<_Tp> _il, _Up&&... _args) {
180         return Primitive(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
181       }
182 
getTag()183       Tag getTag() const {
184         return static_cast<Tag>(_value.index());
185       }
186 
187       template <Tag _tag>
get()188       const auto& get() const {
189         if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
190         return std::get<static_cast<size_t>(_tag)>(_value);
191       }
192 
193       template <Tag _tag>
get()194       auto& get() {
195         if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
196         return std::get<static_cast<size_t>(_tag)>(_value);
197       }
198 
199       template <Tag _tag, typename... _Tp>
set(_Tp &&..._args)200       void set(_Tp&&... _args) {
201         _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
202       }
203 
204       inline bool operator==(const Primitive& _rhs) const {
205         return _value == _rhs._value;
206       }
207       inline bool operator<(const Primitive& _rhs) const {
208         return _value < _rhs._value;
209       }
210       inline bool operator!=(const Primitive& _rhs) const {
211         return !(*this == _rhs);
212       }
213       inline bool operator>(const Primitive& _rhs) const {
214         return _rhs < *this;
215       }
216       inline bool operator>=(const Primitive& _rhs) const {
217         return !(*this < _rhs);
218       }
219       inline bool operator<=(const Primitive& _rhs) const {
220         return !(_rhs < *this);
221       }
222 
223       ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
224       ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
getParcelableDescriptor()225       static const ::android::String16& getParcelableDescriptor() {
226         static const ::android::StaticString16 DESCRIPTOR (u"android.os.StatsBootstrapAtomValue.Annotation.Primitive");
227         return DESCRIPTOR;
228       }
toString()229       inline std::string toString() const {
230         std::ostringstream os;
231         os << "Primitive{";
232         switch (getTag()) {
233         case boolValue: os << "boolValue: " << ::android::internal::ToString(get<boolValue>()); break;
234         case intValue: os << "intValue: " << ::android::internal::ToString(get<intValue>()); break;
235         }
236         os << "}";
237         return os.str();
238       }
239     private:
240       std::variant<bool, int32_t> _value;
241     };  // class Primitive
242     ::android::os::StatsBootstrapAtomValue::Annotation::Id id = ::android::os::StatsBootstrapAtomValue::Annotation::Id(0);
243     ::android::os::StatsBootstrapAtomValue::Annotation::Primitive value;
244     inline bool operator==(const Annotation& _rhs) const {
245       return std::tie(id, value) == std::tie(_rhs.id, _rhs.value);
246     }
247     inline bool operator<(const Annotation& _rhs) const {
248       return std::tie(id, value) < std::tie(_rhs.id, _rhs.value);
249     }
250     inline bool operator!=(const Annotation& _rhs) const {
251       return !(*this == _rhs);
252     }
253     inline bool operator>(const Annotation& _rhs) const {
254       return _rhs < *this;
255     }
256     inline bool operator>=(const Annotation& _rhs) const {
257       return !(*this < _rhs);
258     }
259     inline bool operator<=(const Annotation& _rhs) const {
260       return !(_rhs < *this);
261     }
262 
263     ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
264     ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
getParcelableDescriptor()265     static const ::android::String16& getParcelableDescriptor() {
266       static const ::android::StaticString16 DESCRIPTOR (u"android.os.StatsBootstrapAtomValue.Annotation");
267       return DESCRIPTOR;
268     }
toString()269     inline std::string toString() const {
270       std::ostringstream _aidl_os;
271       _aidl_os << "Annotation{";
272       _aidl_os << "id: " << ::android::internal::ToString(id);
273       _aidl_os << ", value: " << ::android::internal::ToString(value);
274       _aidl_os << "}";
275       return _aidl_os.str();
276     }
277   };  // class Annotation
278   ::android::os::StatsBootstrapAtomValue::Primitive value;
279   ::std::vector<::android::os::StatsBootstrapAtomValue::Annotation> annotations;
280   inline bool operator==(const StatsBootstrapAtomValue& _rhs) const {
281     return std::tie(value, annotations) == std::tie(_rhs.value, _rhs.annotations);
282   }
283   inline bool operator<(const StatsBootstrapAtomValue& _rhs) const {
284     return std::tie(value, annotations) < std::tie(_rhs.value, _rhs.annotations);
285   }
286   inline bool operator!=(const StatsBootstrapAtomValue& _rhs) const {
287     return !(*this == _rhs);
288   }
289   inline bool operator>(const StatsBootstrapAtomValue& _rhs) const {
290     return _rhs < *this;
291   }
292   inline bool operator>=(const StatsBootstrapAtomValue& _rhs) const {
293     return !(*this < _rhs);
294   }
295   inline bool operator<=(const StatsBootstrapAtomValue& _rhs) const {
296     return !(_rhs < *this);
297   }
298 
299   ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
300   ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
getParcelableDescriptor()301   static const ::android::String16& getParcelableDescriptor() {
302     static const ::android::StaticString16 DESCRIPTOR (u"android.os.StatsBootstrapAtomValue");
303     return DESCRIPTOR;
304   }
toString()305   inline std::string toString() const {
306     std::ostringstream _aidl_os;
307     _aidl_os << "StatsBootstrapAtomValue{";
308     _aidl_os << "value: " << ::android::internal::ToString(value);
309     _aidl_os << ", annotations: " << ::android::internal::ToString(annotations);
310     _aidl_os << "}";
311     return _aidl_os.str();
312   }
313 };  // class StatsBootstrapAtomValue
314 }  // namespace os
315 }  // namespace android
316 namespace android {
317 namespace os {
toString(StatsBootstrapAtomValue::Primitive::Tag val)318 [[nodiscard]] static inline std::string toString(StatsBootstrapAtomValue::Primitive::Tag val) {
319   switch(val) {
320   case StatsBootstrapAtomValue::Primitive::Tag::boolValue:
321     return "boolValue";
322   case StatsBootstrapAtomValue::Primitive::Tag::intValue:
323     return "intValue";
324   case StatsBootstrapAtomValue::Primitive::Tag::longValue:
325     return "longValue";
326   case StatsBootstrapAtomValue::Primitive::Tag::floatValue:
327     return "floatValue";
328   case StatsBootstrapAtomValue::Primitive::Tag::stringValue:
329     return "stringValue";
330   case StatsBootstrapAtomValue::Primitive::Tag::bytesValue:
331     return "bytesValue";
332   case StatsBootstrapAtomValue::Primitive::Tag::stringArrayValue:
333     return "stringArrayValue";
334   default:
335     return std::to_string(static_cast<int32_t>(val));
336   }
337 }
338 }  // namespace os
339 }  // namespace android
340 namespace android {
341 namespace internal {
342 #pragma clang diagnostic push
343 #pragma clang diagnostic ignored "-Wc++17-extensions"
344 template <>
345 constexpr inline std::array<::android::os::StatsBootstrapAtomValue::Primitive::Tag, 7> enum_values<::android::os::StatsBootstrapAtomValue::Primitive::Tag> = {
346   ::android::os::StatsBootstrapAtomValue::Primitive::Tag::boolValue,
347   ::android::os::StatsBootstrapAtomValue::Primitive::Tag::intValue,
348   ::android::os::StatsBootstrapAtomValue::Primitive::Tag::longValue,
349   ::android::os::StatsBootstrapAtomValue::Primitive::Tag::floatValue,
350   ::android::os::StatsBootstrapAtomValue::Primitive::Tag::stringValue,
351   ::android::os::StatsBootstrapAtomValue::Primitive::Tag::bytesValue,
352   ::android::os::StatsBootstrapAtomValue::Primitive::Tag::stringArrayValue,
353 };
354 #pragma clang diagnostic pop
355 }  // namespace internal
356 }  // namespace android
357 namespace android {
358 namespace os {
toString(StatsBootstrapAtomValue::Annotation::Id val)359 [[nodiscard]] static inline std::string toString(StatsBootstrapAtomValue::Annotation::Id val) {
360   switch(val) {
361   case StatsBootstrapAtomValue::Annotation::Id::NONE:
362     return "NONE";
363   case StatsBootstrapAtomValue::Annotation::Id::IS_UID:
364     return "IS_UID";
365   default:
366     return std::to_string(static_cast<int8_t>(val));
367   }
368 }
369 }  // namespace os
370 }  // namespace android
371 namespace android {
372 namespace internal {
373 #pragma clang diagnostic push
374 #pragma clang diagnostic ignored "-Wc++17-extensions"
375 template <>
376 constexpr inline std::array<::android::os::StatsBootstrapAtomValue::Annotation::Id, 2> enum_values<::android::os::StatsBootstrapAtomValue::Annotation::Id> = {
377   ::android::os::StatsBootstrapAtomValue::Annotation::Id::NONE,
378   ::android::os::StatsBootstrapAtomValue::Annotation::Id::IS_UID,
379 };
380 #pragma clang diagnostic pop
381 }  // namespace internal
382 }  // namespace android
383 namespace android {
384 namespace os {
toString(StatsBootstrapAtomValue::Annotation::Primitive::Tag val)385 [[nodiscard]] static inline std::string toString(StatsBootstrapAtomValue::Annotation::Primitive::Tag val) {
386   switch(val) {
387   case StatsBootstrapAtomValue::Annotation::Primitive::Tag::boolValue:
388     return "boolValue";
389   case StatsBootstrapAtomValue::Annotation::Primitive::Tag::intValue:
390     return "intValue";
391   default:
392     return std::to_string(static_cast<int32_t>(val));
393   }
394 }
395 }  // namespace os
396 }  // namespace android
397 namespace android {
398 namespace internal {
399 #pragma clang diagnostic push
400 #pragma clang diagnostic ignored "-Wc++17-extensions"
401 template <>
402 constexpr inline std::array<::android::os::StatsBootstrapAtomValue::Annotation::Primitive::Tag, 2> enum_values<::android::os::StatsBootstrapAtomValue::Annotation::Primitive::Tag> = {
403   ::android::os::StatsBootstrapAtomValue::Annotation::Primitive::Tag::boolValue,
404   ::android::os::StatsBootstrapAtomValue::Annotation::Primitive::Tag::intValue,
405 };
406 #pragma clang diagnostic pop
407 }  // namespace internal
408 }  // namespace android
409