diff --git a/include/MantleAPI/Execution/i_environment.h b/include/MantleAPI/Execution/i_environment.h index f3e33a01c48576d4d4ae7769724dba53f73147bc..42efef841919836d0e9a7c14fc42edb24409fdc0 100644 --- a/include/MantleAPI/Execution/i_environment.h +++ b/include/MantleAPI/Execution/i_environment.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021-2022, Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2021-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG) * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -43,14 +43,17 @@ public: /// environment must do so. virtual void CreateMap(const std::string& map_file_path, const mantle_api::MapDetails& map_details) = 0; - /// Assigns an entity to a copy of the specified controller. This controller needs to be created beforehand. Only - /// one controller can be added to an entity + /// Assigns an entity to the specified controller. This controller needs to be created beforehand. /// /// @param entity The entity to be manipulated by the specified controller. /// @param controller_id Identifies the controller to manipulate the entity. virtual void AddEntityToController(IEntity& entity, UniqueId controller_id) = 0; - virtual void RemoveControllerFromEntity(UniqueId entity_id) = 0; + /// Removes an entity from the specified controller. + /// + /// @param entity_id The entity to remove + /// @param controller_id The controller from which the entity is removed + virtual void RemoveEntityFromController(UniqueId entity_id, UniqueId controller_id) = 0; /// Updates the control strategies for an entity. /// diff --git a/include/MantleAPI/Traffic/i_controller.h b/include/MantleAPI/Traffic/i_controller.h index fd4a5eb068a49064c003814768951afe1c2aa4fe..570361d70869aa4439455bb6aa337ee72d408c75 100644 --- a/include/MantleAPI/Traffic/i_controller.h +++ b/include/MantleAPI/Traffic/i_controller.h @@ -1,5 +1,6 @@ /******************************************************************************** * Copyright (c) 2021 in-tech GmbH + * 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -21,6 +22,18 @@ namespace mantle_api /// Base interface for all controllers. class IController : public IIdentifiable { +public: + /// Activates the controller for the lateral domain + virtual void ActivateLateral() = 0; + + /// Deactivates the controller for the lateral domain + virtual void DeactivateLateral() = 0; + + /// Activates the controller for the longitudinal domain + virtual void ActivateLongitudinal() = 0; + + /// Deactivates the controller for the longitudinal domain + virtual void DeactivateLongitudinal() = 0; }; } // namespace mantle_api \ No newline at end of file diff --git a/test/MantleAPI/Test/test_utils.h b/test/MantleAPI/Test/test_utils.h index aa7db38ac412d998342c670ddeb5bc9c39813da3..dce3fa13afe14c0145851c17a5dce8610eb327f2 100644 --- a/test/MantleAPI/Test/test_utils.h +++ b/test/MantleAPI/Test/test_utils.h @@ -394,6 +394,26 @@ public: GetName, (), (const, override)); + + MOCK_METHOD(void, + ActivateLateral, + (), + (override)); + + MOCK_METHOD(void, + DeactivateLateral, + (), + (override)); + + MOCK_METHOD(void, + ActivateLongitudinal, + (), + (override)); + + MOCK_METHOD(void, + DeactivateLongitudinal, + (), + (override)); }; class MockControllerRepository : public mantle_api::IControllerRepository @@ -439,7 +459,7 @@ public: ); - MOCK_METHOD(void, RemoveControllerFromEntity, (std::uint64_t entity_id), (override)); + MOCK_METHOD(void, RemoveEntityFromController, (std::uint64_t entity_id, std::uint64_t controller_id), (override)); MOCK_METHOD(void, UpdateControlStrategies,