1676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong/*
2676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong * Copyright (C) 2017 The Android Open Source Project
3676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong *
4676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong * Licensed under the Apache License, Version 2.0 (the "License");
5676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong * you may not use this file except in compliance with the License.
6676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong * You may obtain a copy of the License at
7676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong *
8676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong *      http://www.apache.org/licenses/LICENSE-2.0
9676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong *
10676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong * Unless required by applicable law or agreed to in writing, software
11676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong * distributed under the License is distributed on an "AS IS" BASIS,
12676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong * See the License for the specific language governing permissions and
14676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong * limitations under the License.
15676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong */
16676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong
17676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong#ifndef ANDROID_VINTF_MATRIX_HAL_H
18676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong#define ANDROID_VINTF_MATRIX_HAL_H
19676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong
209cd9eb0f06e77347beaf141c011fb1989af82475Yifan Hong#include <map>
21676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong#include <string>
22676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong#include <vector>
23676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong
24676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong#include "HalFormat.h"
259cd9eb0f06e77347beaf141c011fb1989af82475Yifan Hong#include "HalInterface.h"
26676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong#include "VersionRange.h"
27676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong
28676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hongnamespace android {
29676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hongnamespace vintf {
30676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong
31676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong// A HAL entry to a compatibility matrix
32676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hongstruct MatrixHal {
33676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong
34676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong    bool operator==(const MatrixHal &other) const;
35676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong
36676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong    HalFormat format = HalFormat::HIDL;
37676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong    std::string name;
38676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong    std::vector<VersionRange> versionRanges;
39676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong    bool optional = false;
409cd9eb0f06e77347beaf141c011fb1989af82475Yifan Hong    std::map<std::string, HalInterface> interfaces;
410fd7aeff56fc919dd70aeddfa10df39b4ca7e9a7Yifan Hong
420fd7aeff56fc919dd70aeddfa10df39b4ca7e9a7Yifan Hong    inline const std::string& getName() const { return name; }
43676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong};
44676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong
45676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong} // namespace vintf
46676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong} // namespace android
47676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong
48676447acd00ebf93d1023f79fc02b5cbbb86dda2Yifan Hong#endif // ANDROID_VINTF_MATRIX_HAL_H
49