Skip to content

Commit

Permalink
Const correctness for cse::execution (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
THEvang committed Apr 2, 2020
1 parent c35db24 commit dc8dc3c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions include/cse/execution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,16 @@ class execution
void set_real_time_factor_target(double realTimeFactor);

/// Returns if this is a real time simulation
bool is_real_time_simulation();
bool is_real_time_simulation() const;

/// Returns the current real time factor
double get_measured_real_time_factor();
double get_measured_real_time_factor() const;

/// Returns the current real time factor target
double get_real_time_factor_target();
double get_real_time_factor_target() const;

/// Returns a map of currently modified variables
std::vector<variable_id> get_modified_variables();
std::vector<variable_id> get_modified_variables() const;

/// Set initial value for a variable of type real. Must be called before simulation is started.
void set_real_initial_value(simulator_index sim, value_reference var, double value);
Expand Down
6 changes: 3 additions & 3 deletions include/cse/timer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ class real_time_timer
void disable_real_time_simulation();

/// Returns if this is a real time simulation
bool is_real_time_simulation();
bool is_real_time_simulation() const;

/// Returns the current real time factor
double get_measured_real_time_factor();
double get_measured_real_time_factor() const;

/// Sets a custom real time factor
void set_real_time_factor_target(double realTimeFactor);

/// Returns the current real time factor target
double get_real_time_factor_target();
double get_real_time_factor_target() const;

/// Constructor
real_time_timer();
Expand Down
16 changes: 8 additions & 8 deletions src/cpp/execution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ class execution::impl
timer_.disable_real_time_simulation();
}

bool is_real_time_simulation()
bool is_real_time_simulation() const
{
return timer_.is_real_time_simulation();
}

double get_measured_real_time_factor()
double get_measured_real_time_factor() const
{
return timer_.get_measured_real_time_factor();
}
Expand All @@ -182,12 +182,12 @@ class execution::impl
timer_.set_real_time_factor_target(realTimeFactor);
}

double get_real_time_factor_target()
double get_real_time_factor_target() const
{
return timer_.get_real_time_factor_target();
}

std::vector<variable_id> get_modified_variables()
std::vector<variable_id> get_modified_variables() const
{
std::vector<variable_id> modifiedVariables;

Expand Down Expand Up @@ -414,12 +414,12 @@ void execution::disable_real_time_simulation()
pimpl_->disable_real_time_simulation();
}

bool execution::is_real_time_simulation()
bool execution::is_real_time_simulation() const
{
return pimpl_->is_real_time_simulation();
}

double execution::get_measured_real_time_factor()
double execution::get_measured_real_time_factor() const
{
return pimpl_->get_measured_real_time_factor();
}
Expand All @@ -429,12 +429,12 @@ void execution::set_real_time_factor_target(double realTimeFactor)
pimpl_->set_real_time_factor_target(realTimeFactor);
}

double execution::get_real_time_factor_target()
double execution::get_real_time_factor_target() const
{
return pimpl_->get_real_time_factor_target();
}

std::vector<variable_id> execution::get_modified_variables()
std::vector<variable_id> execution::get_modified_variables() const
{
return pimpl_->get_modified_variables();
}
Expand Down
6 changes: 3 additions & 3 deletions src/cpp/timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ void real_time_timer::disable_real_time_simulation()
pimpl_->disable_real_time_simulation();
}

bool real_time_timer::is_real_time_simulation()
bool real_time_timer::is_real_time_simulation() const
{
return pimpl_->is_real_time_simulation();
}

double real_time_timer::get_measured_real_time_factor()
double real_time_timer::get_measured_real_time_factor() const
{
return pimpl_->get_measured_real_time_factor();
}
Expand All @@ -153,7 +153,7 @@ void real_time_timer::set_real_time_factor_target(double realTimeFactor)
pimpl_->set_real_time_factor_target(realTimeFactor);
}

double real_time_timer::get_real_time_factor_target()
double real_time_timer::get_real_time_factor_target() const
{
return pimpl_->get_real_time_factor_target();
}
Expand Down

2 comments on commit dc8dc3c

@markaren
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess this commit was supposed to be a PR, but was accidentally pushed to master instead?

@ljamt
Copy link
Member

@ljamt ljamt commented on dc8dc3c Apr 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. We should use git hooks to preventing that from happening.

Please sign in to comment.