Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
|
A datatype to allow the running of command-line applications in a separate task. More...
#include <system_async_task.h>
Public Member Functions | |
SystemAsyncTask * | AllocateSystemAsyncTask (ServiceJob *job_p, const char *name_s, struct AsyncTasksManager *manager_p, bool add_flag, const char *command_s, void(*on_success_callback_fn)(ServiceJob *job_p)) |
Allocate a SystemAsyncTask. More... | |
bool | SetSystemAsyncTaskCommand (SystemAsyncTask *task_p, const char *command_s) |
Set the command line for a SystemAsyncTask to run. More... | |
void | FreeSystemAsyncTask (SystemAsyncTask *task_p) |
Free a SystemAsyncTask. More... | |
bool | RunSystemAsyncTask (SystemAsyncTask *task_p) |
Run a SystemAsyncTask. More... | |
Data Fields | |
AsyncTask * | std_async_task_p |
The underlying AsyncTask. More... | |
MEM_FLAG | std_async_task_mem |
The MEM_FLAG determining whether the AsyncTask pointed to by std_async_task_p will be deleted when this SystemAsyncTask is freed. More... | |
ServiceJob * | std_service_job_p |
The ServiceJob that will run this SystemAsyncTask. More... | |
char * | std_command_line_s |
The command line that this SystemAsyncTask will run. More... | |
void(* | std_on_success_callback_fn )(ServiceJob *job_p) |
The callback function that this SystemAsyncTask will call if it runs successfully. More... | |
A datatype to allow the running of command-line applications in a separate task.
SystemAsyncTask * AllocateSystemAsyncTask | ( | ServiceJob * | job_p, |
const char * | name_s, | ||
struct AsyncTasksManager * | manager_p, | ||
bool | add_flag, | ||
const char * | command_s, | ||
void(*)(ServiceJob *job_p) | on_success_callback_fn | ||
) |
Allocate a SystemAsyncTask.
job_p | The ServiceJob that will run this SystemAsyncTask. |
name_s | The name to give to the underlying AsyncTask. The SystemAsyncTask will make a deep copy of this value. |
manager_p | The AsyncTasksManager for this AsyncTask. |
add_flag | If this is true then this SystemAsyncTask will be added to the AsyncTasksManager specified by manager_p. If this is false , then this SystemAsyncTask is not added to the given AsyncTasksManager. |
command_s | The command line that this SystemAsyncTask will run. The SystemAsyncTask will make a deep copy of this value. |
on_success_callback_fn | If the SystemAsyncTask runs successfully, this function will be called with the SystemAsyncTask's ServiceJob as its parameter. |
NULL
upon error. bool SetSystemAsyncTaskCommand | ( | SystemAsyncTask * | task_p, |
const char * | command_s | ||
) |
Set the command line for a SystemAsyncTask to run.
task_p | The SystemAsyncTask to alter. |
command_s | The command line to run. The SystemAsyncTask will make a deep-copy of this value. |
true
if the ServiceJob was altered successfully, false
otherwise. void FreeSystemAsyncTask | ( | SystemAsyncTask * | task_p | ) |
Free a SystemAsyncTask.
task_p | The SystemAsyncTask to free. |
bool RunSystemAsyncTask | ( | SystemAsyncTask * | task_p | ) |
Run a SystemAsyncTask.
task_p | The SystemAsyncTask to run. |
true
if the ServiceJob was started successfully, false
otherwise. MEM_FLAG std_async_task_mem |
The MEM_FLAG determining whether the AsyncTask pointed to by std_async_task_p will be deleted when this SystemAsyncTask is freed.
ServiceJob* std_service_job_p |
The ServiceJob that will run this SystemAsyncTask.
The SystemAsyncTask will not free this ServiceJob when the SystemAsyncTask is deleted so the ServiceJob will need to be freed separately.
char* std_command_line_s |
The command line that this SystemAsyncTask will run.
void(* std_on_success_callback_fn) (ServiceJob *job_p) |
The callback function that this SystemAsyncTask will call if it runs successfully.
If this is NULL
, it will be ignored.