@@ -26,7 +26,7 @@ void engine::subscribe(const subscriber::ptr &sub)
2626}
2727
2828void engine::update (engine_ruleset &ruleset,
29- std::map<std::string_view , std::string> &meta,
29+ std::map<std::string , std::string> &meta,
3030 std::map<std::string_view, double > &metrics)
3131{
3232 auto new_actions =
@@ -75,6 +75,7 @@ std::optional<engine::result> engine::context::publish(parameter &¶m)
7575
7676 std::vector<std::string> event_data;
7777 std::unordered_set<std::string> event_actions;
78+ std::map<std::string, std::string> schemas;
7879
7980 for (auto &sub : common_->subscribers ) {
8081 auto it = listeners_.find (sub);
@@ -88,6 +89,7 @@ std::optional<engine::result> engine::context::publish(parameter &¶m)
8889 std::make_move_iterator (event->data .begin ()),
8990 std::make_move_iterator (event->data .end ()));
9091 event_actions.merge (event->actions );
92+ schemas.merge (event->schemas );
9193 }
9294 } catch (std::exception &e) {
9395 SPDLOG_ERROR (" subscriber failed: {}" , e.what ());
@@ -98,7 +100,8 @@ std::optional<engine::result> engine::context::publish(parameter &¶m)
98100 return std::nullopt ;
99101 }
100102
101- dds::engine::result res{action_type::record, {}, std::move (event_data)};
103+ dds::engine::result res{
104+ action_type::record, {}, std::move (event_data), std::move (schemas)};
102105 // Currently the only action the extension can perform is block
103106 if (!event_actions.empty ()) {
104107 // The extension can only handle one action, so we pick the first one
@@ -119,7 +122,7 @@ std::optional<engine::result> engine::context::publish(parameter &¶m)
119122}
120123
121124void engine::context::get_meta_and_metrics (
122- std::map<std::string_view , std::string> &meta,
125+ std::map<std::string , std::string> &meta,
123126 std::map<std::string_view, double > &metrics)
124127{
125128 for (const auto &[subscriber, listener] : listeners_) {
@@ -231,7 +234,7 @@ engine::action_map engine::parse_actions(
231234}
232235
233236engine::ptr engine::from_settings (const dds::engine_settings &eng_settings,
234- std::map<std::string_view , std::string> &meta,
237+ std::map<std::string , std::string> &meta,
235238 std::map<std::string_view, double > &metrics)
236239
237240{
0 commit comments