blob: 6b9997a46630b68bef994d78c8fb8a34992c925d [file] [log] [blame]
Nirav Atreb4186162018-06-08 16:51:29 -07001/*
2 * Copyright (C) 2018 The Android Open Source Project
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 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_HARDWARE_TESTS_SAFEUNION_V1_0_SAFEUNION_H
18#define ANDROID_HARDWARE_TESTS_SAFEUNION_V1_0_SAFEUNION_H
19
20#include <android/hardware/tests/safeunion/1.0/ISafeUnion.h>
21#include <hidl/MQDescriptor.h>
22#include <hidl/Status.h>
23
24namespace android {
25namespace hardware {
26namespace tests {
27namespace safeunion {
28namespace V1_0 {
29namespace implementation {
30
31using ::android::hardware::Return;
32using ::android::hardware::Void;
33using ::android::hardware::tests::safeunion::V1_0::SmallSafeUnion;
34using ::android::hardware::tests::safeunion::V1_0::LargeSafeUnion;
35using ::android::hardware::tests::safeunion::V1_0::MiscTypesSafeUnion;
36
37struct SafeUnion : public ISafeUnion {
38 // Methods from ::android::hardware::tests::safeunion::V1_0::ISafeUnion follow.
39 Return<void> newLargeSafeUnion(newLargeSafeUnion_cb _hidl_cb) override;
40 Return<void> setA(const LargeSafeUnion& myUnion, int8_t a, setA_cb _hidl_cb) override;
41 Return<void> setB(const LargeSafeUnion& myUnion, uint16_t b, setB_cb _hidl_cb) override;
42 Return<void> setC(const LargeSafeUnion& myUnion, int32_t c, setC_cb _hidl_cb) override;
43 Return<void> setD(const LargeSafeUnion& myUnion, uint64_t d, setD_cb _hidl_cb) override;
44 Return<void> setE(const LargeSafeUnion& myUnion, const hidl_array<int8_t, 13>& e, setE_cb _hidl_cb) override;
45 Return<void> setF(const LargeSafeUnion& myUnion, const hidl_array<int64_t, 5>& f, setF_cb _hidl_cb) override;
46 Return<void> setG(const LargeSafeUnion& myUnion, const hidl_string& g, setG_cb _hidl_cb) override;
47 Return<void> setH(const LargeSafeUnion& myUnion, const hidl_vec<bool>& h, setH_cb _hidl_cb) override;
48 Return<void> setI(const LargeSafeUnion& myUnion, const hidl_vec<uint64_t>& i, setI_cb _hidl_cb) override;
49 Return<void> setJ(const LargeSafeUnion& myUnion, const J& j, setJ_cb _hidl_cb) override;
50 Return<void> setK(const LargeSafeUnion& myUnion, const LargeSafeUnion::K& k, setK_cb _hidl_cb) override;
51 Return<void> setL(const LargeSafeUnion& myUnion, const SmallSafeUnion& l, setL_cb _hidl_cb) override;
52
53 Return<void> newMiscTypesSafeUnion(newMiscTypesSafeUnion_cb _hidl_cb) override;
54 Return<void> setMiscA(const ::android::hardware::tests::safeunion::V1_0::MiscTypesSafeUnion& myUnion, const hidl_memory& a, setMiscA_cb _hidl_cb) override;
55 Return<void> setMiscB(const ::android::hardware::tests::safeunion::V1_0::MiscTypesSafeUnion& myUnion, const hidl_handle& b, setMiscB_cb _hidl_cb) override;
56 Return<void> setMiscC(const ::android::hardware::tests::safeunion::V1_0::MiscTypesSafeUnion& myUnion, hidl_bitfield<BitField> c, setMiscC_cb _hidl_cb) override;
57};
58
59extern "C" ISafeUnion* HIDL_FETCH_ISafeUnion(const char* name);
60
61} // namespace implementation
62} // namespace V1_0
63} // namespace safeunion
64} // namespace tests
65} // namespace hardware
66} // namespace android
67
68#endif // ANDROID_HARDWARE_TESTS_SAFEUNION_V1_0_SAFEUNION_H