1 /*
2  * Copyright (C) 2017 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 
18 #ifndef ANDROID_VINTF_TRANSPORT_ARCH_H
19 #define ANDROID_VINTF_TRANSPORT_ARCH_H
20 
21 #include "Arch.h"
22 #include "Transport.h"
23 
24 namespace android {
25 namespace vintf {
26 
27 struct TransportArch {
28     Transport transport = Transport::EMPTY;
29     Arch arch = Arch::ARCH_EMPTY;
30 
31 private:
32     friend struct TransportArchConverter;
33     friend struct ManifestHalConverter;
34     friend struct ManifestHal;
35     friend bool parse(const std::string &s, TransportArch *ta);
36     bool empty() const;
37     // Valid combinations:
38     // <transport arch="32">passthrough</transport>
39     // <transport arch="64">passthrough</transport>
40     // <transport arch="32+64">passthrough</transport>
41     // <transport>hwbinder</transport>
42     // Element doesn't exist
43     bool isValid() const;
44 };
45 
46 
47 } // namespace vintf
48 } // namespace android
49 
50 #endif // ANDROID_VINTF_TRANSPORT_ARCH_H
51