ManifestInstance.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #ifndef ANDROID_VINTF_MANIFEST_INSTANCE_H
  17. #define ANDROID_VINTF_MANIFEST_INSTANCE_H
  18. #include <string>
  19. #include <hidl-util/FqInstance.h>
  20. #include "HalFormat.h"
  21. #include "TransportArch.h"
  22. #include "Version.h"
  23. namespace android {
  24. namespace vintf {
  25. class ManifestInstance {
  26. public:
  27. ManifestInstance();
  28. ManifestInstance(const ManifestInstance&);
  29. ManifestInstance(ManifestInstance&&) noexcept;
  30. ManifestInstance& operator=(const ManifestInstance&);
  31. ManifestInstance& operator=(ManifestInstance&&) noexcept;
  32. using VersionType = Version;
  33. ManifestInstance(FqInstance&& fqInstance, TransportArch&& ta, HalFormat fmt);
  34. ManifestInstance(const FqInstance& fqInstance, const TransportArch& ta, HalFormat fmt);
  35. const std::string& package() const;
  36. Version version() const;
  37. const std::string& interface() const;
  38. const std::string& instance() const;
  39. Transport transport() const;
  40. Arch arch() const;
  41. HalFormat format() const;
  42. bool operator==(const ManifestInstance& other) const;
  43. bool operator<(const ManifestInstance& other) const;
  44. // Convenience methods.
  45. // return package@version::interface/instance
  46. const FqInstance& getFqInstance() const;
  47. // return @version::interface/instance
  48. FqInstance getFqInstanceNoPackage() const;
  49. private:
  50. FqInstance mFqInstance;
  51. TransportArch mTransportArch;
  52. HalFormat mHalFormat;
  53. };
  54. } // namespace vintf
  55. } // namespace android
  56. #endif // ANDROID_VINTF_MANIFEST_INSTANCE_H