Skip to content

Commit

Permalink
Use allocator from parent
Browse files Browse the repository at this point in the history
  • Loading branch information
f0reachARR committed Sep 26, 2024
1 parent a75ed0b commit 05a0f6c
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ auto Interpreter::publishCurrentContext() const -> void
{
Context context;
{
nlohmann::json json;
boost::json::object json;
boost::json::monotonic_resource mr;
boost::json::object json(&mr);
context.stamp = now();
if (publish_empty_context) {
context.data = "";
Expand Down
2 changes: 1 addition & 1 deletion openscenario/openscenario_interpreter/src/syntax/act.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ auto operator<<(boost::json::object & json, const Act & datum) -> boost::json::o
auto & maneuver_groups = json["ManeuverGroup"].emplace_array();

for (auto && maneuver_group : datum.elements) {
boost::json::object act;
boost::json::object act(json.storage());
act << maneuver_group.as<ManeuverGroup>();
maneuver_groups.push_back(std::move(act));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ auto operator<<(boost::json::object & json, const ConditionGroup & datum) -> boo
auto & conditions = json["Condition"].emplace_array();

for (const auto & each : datum) {
boost::json::object condition;
boost::json::object condition(json.storage());
condition << each;
conditions.push_back(std::move(condition));
}
Expand Down
2 changes: 1 addition & 1 deletion openscenario/openscenario_interpreter/src/syntax/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ auto operator<<(boost::json::object & json, const Event & datum) -> boost::json:
auto & actions = json["Action"].emplace_array();

for (const auto & each : datum.elements) {
boost::json::object action;
boost::json::object action(json.storage());
action << each.as<Action>();
actions.push_back(std::move(action));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,23 @@ auto operator<<(boost::json::object & json, const InitActions & init_actions)
auto & global_actions = json["GlobalAction"].emplace_array();

for (const auto & init_action : init_actions.global_actions) {
boost::json::object action;
boost::json::object action(json.storage());
action["type"] = makeTypename(init_action.as<GlobalAction>().type());
global_actions.push_back(std::move(action));
}

auto & user_defined_actions = json["UserDefinedAction"].emplace_array();

for (const auto & init_action : init_actions.user_defined_actions) {
boost::json::object action;
boost::json::object action(json.storage());
action["type"] = makeTypename(init_action.as<UserDefinedAction>().type());
user_defined_actions.push_back(std::move(action));
}

auto & privates = json["Private"].emplace_array();

for (const auto & init_action : init_actions.privates) {
boost::json::object action;
boost::json::object action(json.storage());
action << init_action.as<Private>();
privates.push_back(std::move(action));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ auto operator<<(boost::json::object & json, const Maneuver & maneuver) -> boost:
auto & events = json["Event"].emplace_array();

for (const auto & event : maneuver.elements) {
boost::json::object json_event;
boost::json::object json_event(json.storage());
json_event << event.as<Event>();
events.push_back(std::move(json_event));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ auto operator<<(boost::json::object & json, const ManeuverGroup & maneuver_group
auto & maneuvers = json["Maneuver"].emplace_array();

for (auto && maneuver : maneuver_group.elements) {
boost::json::object json_maneuver;
boost::json::object json_maneuver(json.storage());
json_maneuver << maneuver.as<Maneuver>();
maneuvers.push_back(std::move(json_maneuver));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ auto operator<<(boost::json::object & json, const Private & datum) -> boost::jso
auto & private_actions = json["PrivateAction"].emplace_array();

for (const auto & private_action : datum.private_actions) {
boost::json::object action;
boost::json::object action(json.storage());
action["type"] = makeTypename(private_action.type());
private_actions.push_back(std::move(action));
}
Expand Down
2 changes: 1 addition & 1 deletion openscenario/openscenario_interpreter/src/syntax/story.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ auto operator<<(boost::json::object & json, const Story & story) -> boost::json:
auto & acts = json["Act"].emplace_array();

for (auto && act : story.elements) {
boost::json::object json_act;
boost::json::object json_act(json.storage());
json_act << act.as<Act>();
acts.push_back(std::move(json_act));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ auto operator<<(boost::json::object & json, const Storyboard & datum) -> boost::
auto & stories = json["Story"].emplace_array();

for (const auto & story : datum.elements) {
boost::json::object each;
boost::json::object each(json.storage());
if (story.is<InitActions>()) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ auto operator<<(boost::json::object & json, const Trigger & datum) -> boost::jso
auto & condition_groups = json["ConditionGroup"].emplace_array();

for (const auto & each : datum) {
boost::json::object condition_group;
boost::json::object condition_group(json.storage());
condition_group << each;
condition_groups.push_back(std::move(condition_group));
}
Expand Down

0 comments on commit 05a0f6c

Please sign in to comment.