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.
count_async_task.h
Go to the documentation of this file.
1 /*
2  * count_async_task_resource.h
3  *
4  * Created on: 9 May 2017
5  * Author: billy
6  */
7 
8 #ifndef CORE_SERVER_TASK_INCLUDE_COUNT_ASYNC_TASK_H_
9 #define CORE_SERVER_TASK_INCLUDE_COUNT_ASYNC_TASK_H_
10 
11 #include "async_task.h"
12 
13 
23 typedef struct CountAsyncTask
24 {
27 
30 
35  int32 cat_limit;
37 
38 
39 
40 #ifdef __cplusplus
41 extern "C"
42 {
43 #endif
44 
45 
57 GRASSROOTS_TASK_API CountAsyncTask *AllocateCountAsyncTask (const char *name_s, struct AsyncTasksManager *manager_p, bool add_flag, int32 limit);
58 
59 
73 GRASSROOTS_TASK_API bool InitCountAsyncTask (CountAsyncTask *count_task_p, const char *name_s, struct AsyncTasksManager *manager_p, bool add_flag, int32 limit);
74 
83 
84 
92 
93 
101 
102 
115 
116 
127 
128 
136 GRASSROOTS_TASK_API void SetCountAsyncTaskLimit (CountAsyncTask *task_p, int32 limit);
137 
138 
139 
140 
141 #ifdef __cplusplus
142 }
143 #endif
144 
145 
146 #endif /* CORE_SERVER_TASK_INCLUDE_COUNT_ASYNC_TASK_H_ */
CountAsyncTask::GetAsyncTaskFromCountAsyncTask
AsyncTask * GetAsyncTaskFromCountAsyncTask(CountAsyncTask *count_task_p)
Get the underlying AsyncTask for a given CountAsyncTask.
CountAsyncTask::IncrementCountAsyncTask
bool IncrementCountAsyncTask(CountAsyncTask *count_task_p)
Increment the counter for a given CountAsyncTask.
CountAsyncTask::FreeCountAsyncTask
void FreeCountAsyncTask(CountAsyncTask *count_task_p)
Free a CountAsyncTask.
CountAsyncTask::ClearCountAsyncTask
void ClearCountAsyncTask(CountAsyncTask *count_task_p)
Remove and free the underlying AsyncTask from a given CountAsyncTask.
CountAsyncTask
A datatype for an AsyncTask that has a counter that sends a signal when that counter reaches a given ...
Definition: count_async_task.h:23
CountAsyncTask::cat_current_value
int32 cat_current_value
The current value of the counter for this CountAsyncTask.
Definition: count_async_task.h:29
AsyncTask
A datatype to use to run tasks asynchronously.
Definition: async_task.h:25
GRASSROOTS_TASK_API
#define GRASSROOTS_TASK_API
Definition: grassroots_task_library.h:46
AsyncTasksManager
A datatype for storing AsyncTasks in a collection.
Definition: async_tasks_manager.h:24
CountAsyncTask::cat_limit
int32 cat_limit
The value at which this CountAsyncTask will send the message saying that it has completed.
Definition: count_async_task.h:35
async_task.h
CountAsyncTask::AllocateCountAsyncTask
CountAsyncTask * AllocateCountAsyncTask(const char *name_s, struct AsyncTasksManager *manager_p, bool add_flag, int32 limit)
Allocate a CountAsyncTask.
CountAsyncTask::cat_task_p
AsyncTask * cat_task_p
The underlying AsyncTask.
Definition: count_async_task.h:26
CountAsyncTask::ContinueCountAsyncTask
bool ContinueCountAsyncTask(const CountAsyncTask *count_task_p)
The default callback function to check whether a CountAsyncTask could continue running.
CountAsyncTask::SetCountAsyncTaskLimit
void SetCountAsyncTaskLimit(CountAsyncTask *task_p, int32 limit)
Set the limit for a given CountAsyncTask.
CountAsyncTask::InitCountAsyncTask
bool InitCountAsyncTask(CountAsyncTask *count_task_p, const char *name_s, struct AsyncTasksManager *manager_p, bool add_flag, int32 limit)
Initialise a CountAsyncTask.