ROS2SimulationInterfacesSystemComponent.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Component/Component.h>
  10. #include <AzCore/std/containers/unordered_map.h>
  11. #include <AzCore/std/smart_ptr/shared_ptr.h>
  12. #include <AzCore/std/string/string.h>
  13. #include <AzFramework/API/ApplicationAPI.h>
  14. #include <SimulationInterfaces/ROS2SimulationInterfacesRequestBus.h>
  15. #include <Interfaces/IROS2HandlerBase.h>
  16. namespace ROS2SimulationInterfaces
  17. {
  18. class ROS2SimulationInterfacesSystemComponent
  19. : public AZ::Component
  20. , public ROS2SimulationInterfacesRequestBus::Handler
  21. {
  22. public:
  23. AZ_COMPONENT_DECL(ROS2SimulationInterfacesSystemComponent);
  24. static void Reflect(AZ::ReflectContext* context);
  25. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  26. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  27. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  28. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  29. ROS2SimulationInterfacesSystemComponent() = default;
  30. ~ROS2SimulationInterfacesSystemComponent() = default;
  31. protected:
  32. // AZ::Component interface implementation
  33. void Activate() override;
  34. void Deactivate() override;
  35. // ROS2SimulationInterfacesRequestBus override
  36. AZStd::unordered_set<SimulationFeatureType> GetSimulationFeatures() override;
  37. private:
  38. AZStd::unordered_map<AZStd::string, AZStd::shared_ptr<IROS2HandlerBase>> m_availableRos2Interface;
  39. };
  40. } // namespace ROS2SimulationInterfaces