Yifan Hong | 2a90ffe | 2018-03-05 17:45:34 -0800 | [diff] [blame^] | 1 | /* |
| 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 | #include "MatrixInstance.h" |
| 18 | |
| 19 | #include <utility> |
| 20 | |
| 21 | namespace android { |
| 22 | namespace vintf { |
| 23 | |
| 24 | MatrixInstance::MatrixInstance(FqInstance&& fqInstance, VersionRange&& range, bool optional) |
| 25 | : mFqInstance(std::move(fqInstance)), mRange(std::move(range)), mOptional(optional) {} |
| 26 | |
| 27 | MatrixInstance::MatrixInstance(const FqInstance fqInstance, const VersionRange& range, |
| 28 | bool optional) |
| 29 | : mFqInstance(fqInstance), mRange(range), mOptional(optional) {} |
| 30 | |
| 31 | const std::string& MatrixInstance::package() const { |
| 32 | return mFqInstance.getPackage(); |
| 33 | } |
| 34 | |
| 35 | const VersionRange& MatrixInstance::versionRange() const { |
| 36 | return mRange; |
| 37 | } |
| 38 | |
| 39 | const std::string& MatrixInstance::interface() const { |
| 40 | return mFqInstance.getInterface(); |
| 41 | } |
| 42 | |
| 43 | const std::string& MatrixInstance::instance() const { |
| 44 | return mFqInstance.getInstance(); |
| 45 | } |
| 46 | |
| 47 | bool MatrixInstance::optional() const { |
| 48 | return mOptional; |
| 49 | } |
| 50 | |
| 51 | } // namespace vintf |
| 52 | } // namespace android |