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

Add interface to set and get user defined values

parent daafebbc
No related branches found
No related tags found
1 merge request!57Add interface to set and get user defined values
......@@ -22,9 +22,10 @@
#include <MantleAPI/Map/i_coord_converter.h>
#include <MantleAPI/Map/i_lane_location_query_service.h>
#include <MantleAPI/Map/map_details.h>
#include <MantleAPI/Traffic/i_entity_repository.h>
#include <MantleAPI/Traffic/i_controller_repository.h>
#include <MantleAPI/Traffic/i_entity_repository.h>
#include <optional>
#include <string>
namespace mantle_api
......@@ -81,12 +82,24 @@ public:
virtual void SetRoadCondition(std::vector<FrictionPatch> friction_patches) = 0;
virtual void SetTrafficSignalState(const std::string& traffic_signal_name, const std::string& traffic_signal_state) = 0;
// Execute a command that is specific for an environment implementation
/// @brief Execute a command that is specific for an environment implementation
///
/// @param actors the actors (if any) for which a command is executed
/// @param type type of the command
/// @param command custom payload
virtual void ExecuteCustomCommand(const std::vector<std::string>& actors, const std::string& type, const std::string& command) = 0;
/// @brief Sets a named user defined value
///
/// @param name The name of the user defined value
/// @param value The value
virtual void SetUserDefinedValue(const std::string& name, const std::string& value) = 0;
/// @brief Gets a named user defined value if it exists
///
/// @param name The name of the user defined value
/// @return The user defined value. No value if it doesn't exist.
virtual std::optional<std::string> GetUserDefinedValue(const std::string& name) = 0;
};
} // namespace mantle_api
......
......@@ -464,6 +464,16 @@ public:
(const std::vector<std::string>& actors, const std::string& type, const std::string& command),
(override));
MOCK_METHOD(void,
SetUserDefinedValue,
(const std::string& name, const std::string& value),
(override));
MOCK_METHOD(std::optional<std::string>,
GetUserDefinedValue,
(const std::string& name),
(override));
void SetDateTime(mantle_api::Time date_time) override { std::ignore = date_time; }
mantle_api::Time GetDateTime() override { return mantle_api::Time(); }
......
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