1*70a7ec85SAndroid Build Coastguard Worker /* 2*70a7ec85SAndroid Build Coastguard Worker * Copyright (C) 2018 The Android Open Source Project 3*70a7ec85SAndroid Build Coastguard Worker * 4*70a7ec85SAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*70a7ec85SAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*70a7ec85SAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*70a7ec85SAndroid Build Coastguard Worker * 8*70a7ec85SAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*70a7ec85SAndroid Build Coastguard Worker * 10*70a7ec85SAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*70a7ec85SAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*70a7ec85SAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*70a7ec85SAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*70a7ec85SAndroid Build Coastguard Worker * limitations under the License. 15*70a7ec85SAndroid Build Coastguard Worker */ 16*70a7ec85SAndroid Build Coastguard Worker 17*70a7ec85SAndroid Build Coastguard Worker #ifndef ANDROID_VINTF_SYSTEM_SDK_H 18*70a7ec85SAndroid Build Coastguard Worker #define ANDROID_VINTF_SYSTEM_SDK_H 19*70a7ec85SAndroid Build Coastguard Worker 20*70a7ec85SAndroid Build Coastguard Worker #include <stdint.h> 21*70a7ec85SAndroid Build Coastguard Worker 22*70a7ec85SAndroid Build Coastguard Worker #include <set> 23*70a7ec85SAndroid Build Coastguard Worker #include <string> 24*70a7ec85SAndroid Build Coastguard Worker 25*70a7ec85SAndroid Build Coastguard Worker namespace android { 26*70a7ec85SAndroid Build Coastguard Worker namespace vintf { 27*70a7ec85SAndroid Build Coastguard Worker 28*70a7ec85SAndroid Build Coastguard Worker // System SDK versions provided for vendor apps. 29*70a7ec85SAndroid Build Coastguard Worker class SystemSdk { 30*70a7ec85SAndroid Build Coastguard Worker public: 31*70a7ec85SAndroid Build Coastguard Worker SystemSdk() = default; SystemSdk(std::set<std::string> && versions)32*70a7ec85SAndroid Build Coastguard Worker SystemSdk(std::set<std::string>&& versions) : mVersions(std::move(versions)) {} SystemSdk(const std::set<std::string> & versions)33*70a7ec85SAndroid Build Coastguard Worker SystemSdk(const std::set<std::string>& versions) : mVersions(versions) {} versions()34*70a7ec85SAndroid Build Coastguard Worker const std::set<std::string>& versions() const { return mVersions; } empty()35*70a7ec85SAndroid Build Coastguard Worker bool empty() const { return versions().empty(); } 36*70a7ec85SAndroid Build Coastguard Worker 37*70a7ec85SAndroid Build Coastguard Worker bool operator==(const SystemSdk& other) const; 38*70a7ec85SAndroid Build Coastguard Worker // return {v : v in this and not in other} 39*70a7ec85SAndroid Build Coastguard Worker SystemSdk removeVersions(const SystemSdk& other) const; 40*70a7ec85SAndroid Build Coastguard Worker 41*70a7ec85SAndroid Build Coastguard Worker // Move all from "other" to "this". 42*70a7ec85SAndroid Build Coastguard Worker void addAll(SystemSdk* other); 43*70a7ec85SAndroid Build Coastguard Worker 44*70a7ec85SAndroid Build Coastguard Worker private: 45*70a7ec85SAndroid Build Coastguard Worker friend class AssembleVintfImpl; 46*70a7ec85SAndroid Build Coastguard Worker friend struct SystemSdkConverter; 47*70a7ec85SAndroid Build Coastguard Worker std::set<std::string> mVersions; 48*70a7ec85SAndroid Build Coastguard Worker }; 49*70a7ec85SAndroid Build Coastguard Worker 50*70a7ec85SAndroid Build Coastguard Worker } // namespace vintf 51*70a7ec85SAndroid Build Coastguard Worker } // namespace android 52*70a7ec85SAndroid Build Coastguard Worker 53*70a7ec85SAndroid Build Coastguard Worker #endif // ANDROID_VINTF_SYSTEM_SDK_H 54