Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose only model description through execution #603

Merged
merged 4 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/cosim/execution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ class execution
/// Returns the current real time factor target
double get_real_time_factor_target() const;

/// Returns the simulator with the given index
std::shared_ptr<const simulator> get_simulator(simulator_index index) const;
/// Returns the model description for a simulator with the given index
model_description get_model_description(simulator_index index) const;

/// Returns a map of currently modified variables
std::vector<variable_id> get_modified_variables() const;
Expand Down
9 changes: 4 additions & 5 deletions src/cosim/execution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ class execution::impl
return timer_.get_real_time_factor_target();
}

std::shared_ptr<const simulator> get_simulator(simulator_index index) const
model_description get_model_description(simulator_index index) const
{
return simulators_.at(index);
return simulators_.at(index)->model_description();
}

std::vector<variable_id> get_modified_variables() const
Expand Down Expand Up @@ -444,10 +444,9 @@ double execution::get_real_time_factor_target() const
return pimpl_->get_real_time_factor_target();
}

std::shared_ptr<const simulator> execution::get_simulator(
simulator_index index) const
model_description execution::get_model_description(simulator_index index) const
{
return pimpl_->get_simulator(index);
return pimpl_->get_model_description(index);
}

std::vector<variable_id> execution::get_modified_variables() const
Expand Down