Andreas Huber | fc0b6c4 | 2016-09-22 09:47:48 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | |
Andreas Huber | 669bf7a | 2016-08-29 10:23:17 -0700 | [diff] [blame] | 17 | package android.hardware.tests.baz@1.0; |
| 18 | |
| 19 | import IBase; |
| 20 | import IBazCallback; |
| 21 | |
| 22 | interface IBaz extends IBase { |
| 23 | |
Yifan Hong | 4093a44 | 2017-02-22 16:07:33 -0800 | [diff] [blame] | 24 | enum BitField : uint8_t { |
| 25 | V0 = 1 << 0, |
| 26 | V1 = 1 << 1, |
| 27 | V2 = 1 << 2, |
| 28 | V3 = 1 << 3, |
| 29 | VALL = V0 | V1 | V2 | V3, |
| 30 | }; |
| 31 | |
Ytai Ben-Tsvi | c861055 | 2019-09-17 12:21:43 -0700 | [diff] [blame] | 32 | struct BitFieldTester { |
| 33 | bitfield<BitField> scalar; |
| 34 | vec<bitfield<BitField>> vector; |
| 35 | }; |
| 36 | |
Andreas Huber | 669bf7a | 2016-08-29 10:23:17 -0700 | [diff] [blame] | 37 | enum SomeOtherEnum : uint8_t { |
| 38 | bar = 66 |
| 39 | }; |
| 40 | |
| 41 | typedef SomeOtherEnum thisIsAnAlias; |
| 42 | typedef IBaz anIBazByAnyOtherName; |
| 43 | |
Steven Moreland | a20d00b | 2018-10-09 10:05:47 -0700 | [diff] [blame] | 44 | struct NastyNester { |
| 45 | struct NestersNasty { |
| 46 | struct NestersNastyNester { |
| 47 | IBaz baz; |
| 48 | vec<NestersNasty> nasties; |
| 49 | }; |
| 50 | }; |
| 51 | |
| 52 | IBaz baz; |
| 53 | }; |
| 54 | |
Andreas Huber | 669bf7a | 2016-08-29 10:23:17 -0700 | [diff] [blame] | 55 | enum SomeEnum : SomeOtherEnum { |
| 56 | quux = 33, |
| 57 | goober = 192, |
| 58 | blah = goober |
| 59 | }; |
| 60 | |
Yifan Hong | 1d57002 | 2016-11-02 13:29:13 -0700 | [diff] [blame] | 61 | typedef int32_t[3] ThreeInts; |
| 62 | struct T { |
| 63 | ThreeInts[5] matrix5x3; |
| 64 | int32_t[3][5] matrix3x5; |
| 65 | }; |
| 66 | |
Pavel Maltsev | af9aec4 | 2017-01-12 16:48:51 -0800 | [diff] [blame] | 67 | struct NestedStruct { |
| 68 | int32_t a; |
| 69 | vec<T> matrices; |
| 70 | }; |
| 71 | |
Yifan Hong | 4093a44 | 2017-02-22 16:07:33 -0800 | [diff] [blame] | 72 | struct Quux { |
| 73 | string first; |
| 74 | string last; |
| 75 | }; |
| 76 | struct Everything { |
| 77 | int8_t number; |
| 78 | int32_t anotherNumber; |
| 79 | string s; |
| 80 | vec<string> vs; |
| 81 | string[2][2] multidimArray; |
| 82 | string[3] sArray; |
| 83 | Quux anotherStruct; |
| 84 | bitfield<BitField> bf; |
| 85 | }; |
| 86 | |
Nirav Atre | 4b34843 | 2018-07-26 21:24:32 -0700 | [diff] [blame] | 87 | struct MyHandle { |
| 88 | handle h; |
| 89 | int32_t guard; |
| 90 | }; |
| 91 | |
Howard Chen | 0cd07d2 | 2018-01-03 15:54:55 +0800 | [diff] [blame] | 92 | struct StructWithInterface { |
| 93 | int32_t number; |
Nirav Atre | 6a8d93f | 2018-07-13 16:03:31 -0700 | [diff] [blame] | 94 | int8_t[7] array; |
| 95 | string oneString; |
| 96 | vec<string> vectorOfStrings; |
Steven Moreland | c0236f0 | 2020-10-01 23:19:01 +0000 | [diff] [blame] | 97 | interface iface; |
Howard Chen | 0cd07d2 | 2018-01-03 15:54:55 +0800 | [diff] [blame] | 98 | }; |
Andreas Huber | 669bf7a | 2016-08-29 10:23:17 -0700 | [diff] [blame] | 99 | oneway doThis(float param); |
| 100 | |
| 101 | doThatAndReturnSomething(int64_t param) generates (int32_t result); |
| 102 | doQuiteABit(int32_t a, int64_t b, float c, double d) generates (double something); |
| 103 | doSomethingElse(int32_t[15] param) generates (int32_t[32] something); |
| 104 | doStuffAndReturnAString() generates (string something); |
| 105 | mapThisVector(vec<int32_t> param) generates (vec<int32_t> something); |
| 106 | callMe(IBazCallback cb); |
Yifan Hong | d9389bb | 2016-12-19 18:02:56 -0800 | [diff] [blame] | 107 | |
| 108 | callMeLater(IBazCallback cb); |
| 109 | iAmFreeNow(); |
Martijn Coenen | 73f99f6 | 2016-12-27 16:21:52 +0100 | [diff] [blame] | 110 | dieNow(); |
Yifan Hong | d9389bb | 2016-12-19 18:02:56 -0800 | [diff] [blame] | 111 | |
Andreas Huber | 669bf7a | 2016-08-29 10:23:17 -0700 | [diff] [blame] | 112 | useAnEnum(SomeEnum zzz) generates (SomeEnum kkk); |
| 113 | |
| 114 | haveSomeStrings(string[3] array) generates (string[2] result); |
| 115 | haveAStringVec(vec<string> vector) generates (vec<string> result); |
Ytai Ben-Tsvi | c861055 | 2019-09-17 12:21:43 -0700 | [diff] [blame] | 116 | repeatBitfieldVec(vec<bitfield<BitField>> vector) generates (vec<bitfield<BitField>> result); |
Andreas Huber | 669bf7a | 2016-08-29 10:23:17 -0700 | [diff] [blame] | 117 | |
| 118 | returnABunchOfStrings() generates (string a, string b, string c); |
Yifan Hong | 8b54c22 | 2016-12-12 15:30:49 -0800 | [diff] [blame] | 119 | |
| 120 | returnABitField() generates (bitfield<BitField> good); |
Yifan Hong | 59cd3a4 | 2016-12-12 10:34:57 -0800 | [diff] [blame] | 121 | |
| 122 | size(uint32_t size) generates (uint32_t size); |
Pavel Maltsev | af9aec4 | 2017-01-12 16:48:51 -0800 | [diff] [blame] | 123 | |
| 124 | getNestedStructs() generates(vec<NestedStruct> data); |
Howard Chen | 0cd07d2 | 2018-01-03 15:54:55 +0800 | [diff] [blame] | 125 | |
| 126 | haveSomeStructWithInterface(StructWithInterface swi) generates(StructWithInterface swi); |
Andreas Huber | 669bf7a | 2016-08-29 10:23:17 -0700 | [diff] [blame] | 127 | }; |