2024-06-10 20:39:17 +00:00
|
|
|
#ifndef cwIoFlowCtl_H
|
|
|
|
#define cwIoFlowCtl_H
|
|
|
|
|
|
|
|
namespace cw
|
|
|
|
{
|
|
|
|
namespace io_flow_ctl
|
|
|
|
{
|
|
|
|
|
|
|
|
typedef handle< struct io_flow_ctl_str > handle_t;
|
|
|
|
|
|
|
|
rc_t create( handle_t& hRef, io::handle_t ioH, const char* flow_cfg_fn );
|
|
|
|
rc_t create( handle_t& hRef, io::handle_t ioH, const object_t* flow_cfg );
|
|
|
|
rc_t destroy( handle_t& hRef );
|
|
|
|
|
2024-09-20 22:16:28 +00:00
|
|
|
// Query the available programs from the 'flow_cfg' file.
|
2024-06-10 20:39:17 +00:00
|
|
|
unsigned program_count( handle_t h);
|
|
|
|
const char* program_title( handle_t h, unsigned pgm_idx );
|
|
|
|
unsigned program_index( handle_t h, const char* pgm_title);
|
2024-09-20 22:16:28 +00:00
|
|
|
|
|
|
|
// Create the parse the program but do not instantiate the network.
|
2024-06-10 20:39:17 +00:00
|
|
|
rc_t program_load( handle_t h, unsigned pgm_idx );
|
|
|
|
|
|
|
|
// Return the index of the currently loaded program or kInvalidIdx if no program is loaded.
|
|
|
|
unsigned program_current_index( handle_t h );
|
|
|
|
|
|
|
|
// Is the currently loaded program in non-real-time mode
|
|
|
|
bool is_program_nrt( handle_t h );
|
|
|
|
|
2024-09-20 22:16:28 +00:00
|
|
|
// Return the count of network presets and the associated labels for the currently loaded program.
|
|
|
|
unsigned program_preset_count( handle_t h );
|
|
|
|
const char* program_preset_title( handle_t h, unsigned preset_idx );
|
|
|
|
|
|
|
|
// Create the network and prepare to enter runtime.
|
|
|
|
rc_t program_initialize( handle_t h, unsigned preset_idx=kInvalidIdx );
|
2024-09-21 21:18:46 +00:00
|
|
|
bool program_is_initialized( handle_t h );
|
2024-09-20 22:16:28 +00:00
|
|
|
|
2024-06-10 20:39:17 +00:00
|
|
|
// Execute the currently loaded non-real-time program to completion.
|
|
|
|
rc_t exec_nrt( handle_t h );
|
|
|
|
|
2024-09-20 22:16:28 +00:00
|
|
|
// Handle an incoming IO msg. This is the main point of entry for executing
|
|
|
|
// real-time programs.
|
2024-06-10 20:39:17 +00:00
|
|
|
rc_t exec( handle_t h, const io::msg_t& msg );
|
|
|
|
|
2024-09-20 22:16:28 +00:00
|
|
|
// Is the current program loaded, initialized and not yet complete.
|
2024-07-01 14:35:24 +00:00
|
|
|
bool is_executable( handle_t h );
|
2024-09-20 22:16:28 +00:00
|
|
|
|
|
|
|
// The current program has completed.
|
2024-07-01 14:35:24 +00:00
|
|
|
bool is_exec_complete( handle_t h );
|
|
|
|
|
2024-06-10 20:39:17 +00:00
|
|
|
void report( handle_t h );
|
|
|
|
void print_network( handle_t h );
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|