File controller.hppΒΆ

namespace o80
template<class STATE>
class Controller
#include <controller.hpp>

Public Functions

Controller()
void set_completed_commands(CompletedCommandsTimeSeries &completed_commands)
void set_starting_commands(CompletedCommandsTimeSeries &starting_commands)
void set_command(const Command<STATE> &command)
void set_backend_period(double backend_period_us)
bool stop_current(const STATE &current_state, Microseconds control_iteration)
void stop_all(const STATE &current_state, Microseconds control_iteration)
int running(const STATE &current_state, Microseconds control_iteration)
void purge()
int size() const
const STATE &get_desired_state(long int current_iteration, const STATE &current_state, const STATE &previous_desired_state, const TimePoint &time_now)
int get_current_command_id() const
void get_newly_executed_commands(std::queue<int> &q)
bool reapplied_desired_state() const

Private Types

typedef time_series::MultiprocessTimeSeries<int> CompletedCommandsTimeSeries

Private Functions

Command<STATE> *get_current_command(long int current_iteration, const STATE &current_state, const STATE &previously_desired_state, const TimePoint &time_now)
void share_completed_command(const Command<STATE> &command)
void reset()

Private Members

CompletedCommandsTimeSeries *completed_commands_
CompletedCommandsTimeSeries *starting_commands_
std::queue<Command<STATE>> queue_
Command<STATE> current_command_
STATE desired_state_
const STATE *current_state_
bool reapplied_desired_state_
double backend_period_us_

Private Static Attributes

static std::mutex mutex_