Skip to content
Snippets Groups Projects
Commit 8607dec3 authored by Andreas Rauschert's avatar Andreas Rauschert
Browse files

Reintroduced const refs for CreateMap and Create static object


Signed-off-by: default avatarAndreas Rauschert <andreas.rb.rauschert@bmw.de>
parent 5842a1f4
No related branches found
No related tags found
1 merge request!16BMW Dev-branch
...@@ -36,7 +36,7 @@ public: ...@@ -36,7 +36,7 @@ public:
/// ///
/// @param file_path map file path from the scenario file. If this path is not resolved by the engine, the /// @param file_path map file path from the scenario file. If this path is not resolved by the engine, the
/// environment must do so. /// environment must do so.
virtual void CreateMap(const std::string& map_file_path, const mantle_api::MapDetails* map_details) = 0; virtual void CreateMap(const std::string& map_file_path, const mantle_api::MapDetails& map_details) = 0;
/// Creates a controller from the given config. A created controller can be assigned to multiple entities /// Creates a controller from the given config. A created controller can be assigned to multiple entities
/// ///
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
namespace mantle_api namespace mantle_api
{ {
struct EntityVisibilityConfig struct EntityVisibilityConfig
{ {
/// The "graphics" flag determines, if the entity shall be shown in visualizations of the simulated environment /// The "graphics" flag determines, if the entity shall be shown in visualizations of the simulated environment
......
...@@ -33,8 +33,8 @@ public: ...@@ -33,8 +33,8 @@ public:
virtual IVehicle& Create(UniqueId id, const std::string& name, const VehicleProperties& properties) = 0; virtual IVehicle& Create(UniqueId id, const std::string& name, const VehicleProperties& properties) = 0;
virtual IPedestrian& Create(const std::string& name, const PedestrianProperties& properties) = 0; virtual IPedestrian& Create(const std::string& name, const PedestrianProperties& properties) = 0;
virtual IPedestrian& Create(UniqueId id, const std::string& name, const PedestrianProperties& properties) = 0; virtual IPedestrian& Create(UniqueId id, const std::string& name, const PedestrianProperties& properties) = 0;
virtual IStaticObject& Create(const std::string& name, std::unique_ptr<mantle_api::StaticObjectProperties> properties) = 0; virtual IStaticObject& Create(const std::string& name, const mantle_api::StaticObjectProperties& properties) = 0;
virtual IStaticObject& Create(UniqueId id, const std::string& name, std::unique_ptr<StaticObjectProperties> properties) = 0; virtual IStaticObject& Create(UniqueId id, const std::string& name, const StaticObjectProperties& properties) = 0;
virtual IVehicle& GetHost() = 0; virtual IVehicle& GetHost() = 0;
virtual std::optional<std::reference_wrapper<IEntity>> Get(const std::string& name) = 0; virtual std::optional<std::reference_wrapper<IEntity>> Get(const std::string& name) = 0;
......
...@@ -252,7 +252,7 @@ public: ...@@ -252,7 +252,7 @@ public:
mantle_api::IStaticObject& Create(mantle_api::UniqueId id, mantle_api::IStaticObject& Create(mantle_api::UniqueId id,
const std::string& name, const std::string& name,
std::unique_ptr<mantle_api::StaticObjectProperties> properties) override const mantle_api::StaticObjectProperties& properties) override
{ {
std::ignore = id; std::ignore = id;
std::ignore = name; std::ignore = name;
...@@ -260,15 +260,10 @@ public: ...@@ -260,15 +260,10 @@ public:
return test_static_object_; return test_static_object_;
} }
mantle_api::IStaticObject& Create(const std::string& name,
std::unique_ptr<mantle_api::StaticObjectProperties> properties) override
{
return CreateStaticObjectProxy(name, *properties);
}
MOCK_METHOD(mantle_api::IStaticObject&, MOCK_METHOD(mantle_api::IStaticObject&,
CreateStaticObjectProxy, Create,
(const std::string& name, const mantle_api::StaticObjectProperties& properties), ()); (const std::string& name, const mantle_api::StaticObjectProperties& properties),
());
std::optional<std::reference_wrapper<IEntity>> Get(const std::string& name) override std::optional<std::reference_wrapper<IEntity>> Get(const std::string& name) override
{ {
...@@ -310,7 +305,7 @@ class MockEnvironment : public mantle_api::IEnvironment ...@@ -310,7 +305,7 @@ class MockEnvironment : public mantle_api::IEnvironment
public: public:
MOCK_METHOD(void, MOCK_METHOD(void,
CreateMap, CreateMap,
(const std::string& file_path, const mantle_api::MapDetails* map_details), (const std::string& file_path, const mantle_api::MapDetails& map_details),
(override) (override)
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment