Commit 8607dec3 authored by Andreas Rauschert's avatar Andreas Rauschert
Browse files

Reintroduced const refs for CreateMap and Create static object


Signed-off-by: Andreas Rauschert's avatarAndreas Rauschert <andreas.rb.rauschert@bmw.de>
parent 5842a1f4
......@@ -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
/// 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
///
......
......@@ -26,7 +26,6 @@
namespace mantle_api
{
struct EntityVisibilityConfig
{
/// The "graphics" flag determines, if the entity shall be shown in visualizations of the simulated environment
......
......@@ -33,8 +33,8 @@ public:
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(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(UniqueId id, const std::string& name, std::unique_ptr<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, const StaticObjectProperties& properties) = 0;
virtual IVehicle& GetHost() = 0;
virtual std::optional<std::reference_wrapper<IEntity>> Get(const std::string& name) = 0;
......
......@@ -252,7 +252,7 @@ public:
mantle_api::IStaticObject& Create(mantle_api::UniqueId id,
const std::string& name,
std::unique_ptr<mantle_api::StaticObjectProperties> properties) override
const mantle_api::StaticObjectProperties& properties) override
{
std::ignore = id;
std::ignore = name;
......@@ -260,15 +260,10 @@ public:
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&,
CreateStaticObjectProxy,
(const std::string& name, const mantle_api::StaticObjectProperties& properties), ());
Create,
(const std::string& name, const mantle_api::StaticObjectProperties& properties),
());
std::optional<std::reference_wrapper<IEntity>> Get(const std::string& name) override
{
......@@ -310,7 +305,7 @@ class MockEnvironment : public mantle_api::IEnvironment
public:
MOCK_METHOD(void,
CreateMap,
(const std::string& file_path, const mantle_api::MapDetails* map_details),
(const std::string& file_path, const mantle_api::MapDetails& map_details),
(override)
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment