Psyllid  v1.12.4
Project 8 Data Acquisisition Software
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
batch_executor Class Reference

A class sequentially execute a list of actions, equivalent to a sequence of dripline requests. More...

#include <batch_executor.hh>

Inheritance diagram for batch_executor:
Inheritance graph

Public Member Functions

 batch_executor ()
 
 batch_executor (const scarab::param_node &a_master_config, std::shared_ptr< request_receiver > a_request_receiver)
 
virtual ~batch_executor ()
 
 mv_referrable_const (scarab::param_node, batch_commands)
 
void clear_queue ()
 
void add_to_queue (const scarab::param_node &an_action)
 
void add_to_queue (const scarab::param_array &actions_array)
 
void add_to_queue (const std::string &a_batch_command_name)
 
void replace_queue (const scarab::param_node &an_action)
 
void replace_queue (const scarab::param_array &actions_array)
 
void replace_queue (const std::string &a_batch_command_name)
 
dripline::reply_ptr_t do_batch_cmd_request (const std::string &a_command, const dripline::request_ptr_t a_request)
 
dripline::reply_ptr_t do_replace_actions_request (const std::string &a_command, const dripline::request_ptr_t a_request)
 
void execute (std::condition_variable &a_daq_control_ready_cv, std::mutex &a_daq_control_ready_mutex, bool a_run_forever=false)
 
- Public Member Functions inherited from control_access
 control_access ()
 
virtual ~control_access ()
 

Private Member Functions

void do_an_action ()
 

Static Private Member Functions

static action_info parse_action (const scarab::param_node &a_action)
 

Private Attributes

std::shared_ptr< request_receiverf_request_receiver
 
scarab::concurrent_queue< action_infof_action_queue
 
scarab::param_node f_condition_actions
 

Additional Inherited Members

- Public Types inherited from control_access
typedef std::shared_ptr< daq_controldc_ptr_t
 
- Static Public Member Functions inherited from control_access
static void set_daq_control (std::weak_ptr< daq_control > a_daq_control)
 
- Protected Member Functions inherited from control_access
dc_ptr_t use_daq_control ()
 
bool daq_control_expired ()
 
- Static Protected Attributes inherited from control_access
static std::weak_ptr< daq_controlf_daq_control = std::weak_ptr< daq_control >()
 

Detailed Description

A class sequentially execute a list of actions, equivalent to a sequence of dripline requests.

Author
B. H. LaRoque

batch_executor is a control component used to submit a pre-defined sequence of requests upon startup and in a non-interactive way. This allows submission of any request which would normally be sent via a dripline request. It can also supports (currently one) custom command (type = wait-for), which will poll the provided rks and wait for the return payload to not indicate a daq_status of running.

The actions taken are defined in the top-level param_node of psyllid's config file named "batch-actions", which must be of type array. Each element of the array is expected to be another param_node and have the following keys:

Definition at line 58 of file batch_executor.hh.

Constructor & Destructor Documentation

◆ batch_executor() [1/2]

Definition at line 31 of file batch_executor.cc.

◆ batch_executor() [2/2]

batch_executor ( const scarab::param_node &  a_master_config,
std::shared_ptr< request_receiver a_request_receiver 
)

Definition at line 41 of file batch_executor.cc.

◆ ~batch_executor()

~batch_executor ( )
virtual

Definition at line 67 of file batch_executor.cc.

Member Function Documentation

◆ add_to_queue() [1/3]

void add_to_queue ( const scarab::param_node &  an_action)

Definition at line 79 of file batch_executor.cc.

◆ add_to_queue() [2/3]

void add_to_queue ( const scarab::param_array &  actions_array)

Definition at line 84 of file batch_executor.cc.

◆ add_to_queue() [3/3]

void add_to_queue ( const std::string &  a_batch_command_name)

Definition at line 94 of file batch_executor.cc.

◆ clear_queue()

void clear_queue ( )

Definition at line 71 of file batch_executor.cc.

◆ do_an_action()

void do_an_action ( )
private

Definition at line 189 of file batch_executor.cc.

◆ do_batch_cmd_request()

dripline::reply_ptr_t do_batch_cmd_request ( const std::string &  a_command,
const dripline::request_ptr_t  a_request 
)

Definition at line 125 of file batch_executor.cc.

◆ do_replace_actions_request()

dripline::reply_ptr_t do_replace_actions_request ( const std::string &  a_command,
const dripline::request_ptr_t  a_request 
)

Definition at line 139 of file batch_executor.cc.

◆ execute()

void execute ( std::condition_variable &  a_daq_control_ready_cv,
std::mutex &  a_daq_control_ready_mutex,
bool  a_run_forever = false 
)

Definition at line 162 of file batch_executor.cc.

◆ mv_referrable_const()

mv_referrable_const ( scarab::param_node  ,
batch_commands   
)

◆ parse_action()

action_info parse_action ( const scarab::param_node &  a_action)
staticprivate

Definition at line 227 of file batch_executor.cc.

◆ replace_queue() [1/3]

void replace_queue ( const scarab::param_node &  an_action)

Definition at line 106 of file batch_executor.cc.

◆ replace_queue() [2/3]

void replace_queue ( const scarab::param_array &  actions_array)

Definition at line 112 of file batch_executor.cc.

◆ replace_queue() [3/3]

void replace_queue ( const std::string &  a_batch_command_name)

Definition at line 118 of file batch_executor.cc.

Member Data Documentation

◆ f_action_queue

scarab::concurrent_queue< action_info > f_action_queue
private

Definition at line 83 of file batch_executor.hh.

◆ f_condition_actions

scarab::param_node f_condition_actions
private

Definition at line 84 of file batch_executor.hh.

◆ f_request_receiver

std::shared_ptr<request_receiver> f_request_receiver
private

Definition at line 82 of file batch_executor.hh.


The documentation for this class was generated from the following files: