Mercury
mercury_request.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Argonne National Laboratory, Department of Energy,
3  *                    UChicago Argonne, LLC and The HDF Group.
4  * All rights reserved.
5  *
6  * The full copyright notice, including terms governing use, modification,
7  * and redistribution, is contained in the COPYING file that can be
8  * found at the root of the source code distribution tree.
9  */
10 
11 #ifndef MERCURY_REQUEST_H
12 #define MERCURY_REQUEST_H
13 
14 #include "mercury_util_config.h"
15 
21 typedef struct hg_request_class hg_request_class_t; /* Opaque request class */
22 typedef struct hg_request_object hg_request_object_t; /* Opaque request object */
23 
33 typedef int (*hg_request_progress_func_t)(unsigned int timeout, void *arg);
34 
45 typedef int (*hg_request_trigger_func_t)(unsigned int timeout,
46  unsigned int *flag, void *arg);
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
63 HG_UTIL_EXPORT hg_request_class_t *
65  hg_request_trigger_func_t trigger, void *arg);
66 
72 HG_UTIL_EXPORT int
74 
85 HG_UTIL_EXPORT hg_request_object_t *
87 
95 HG_UTIL_EXPORT int
97 
106 HG_UTIL_EXPORT int
108 
118 HG_UTIL_EXPORT int
119 hg_request_wait(hg_request_object_t *request, unsigned int timeout,
120  unsigned int *flag);
121 
132 HG_UTIL_EXPORT int
133 hg_request_waitall(int count, hg_request_object_t *request[],
134  unsigned int timeout, unsigned int *flag);
135 
144 HG_UTIL_EXPORT int
145 hg_request_set_data(hg_request_object_t *request, void *data);
146 
154 HG_UTIL_EXPORT void *
156 
168 #ifdef __cplusplus
169 }
170 #endif
171 
172 #endif /* MERCURY_REQUEST_H */
struct hg_request_class hg_request_class_t
Purpose: define a request emulation library on top of the callback model that uses progress/trigger f...
HG_UTIL_EXPORT int hg_request_wait(hg_request_object_t *request, unsigned int timeout, unsigned int *flag)
Wait timeout ms for the specified request to complete.
HG_UTIL_EXPORT hg_request_object_t * hg_request_create(hg_request_class_t *request_class)
Create a new request from a specified request class.
HG_UTIL_EXPORT void * hg_request_get_data(hg_request_object_t *request)
Get user data from a specified request.
HG_UTIL_EXPORT int hg_request_set_data(hg_request_object_t *request, void *data)
Attach user data to a specified request.
HG_UTIL_EXPORT int hg_request_finalize(hg_request_class_t *request_class)
Finalize the request class.
int(* hg_request_trigger_func_t)(unsigned int timeout, unsigned int *flag, void *arg)
Trigger callback, arg can be used to pass extra parameters required by underlying API...
HG_UTIL_EXPORT int hg_request_destroy(hg_request_object_t *request)
Destroy the request, freeing the resources.
HG_UTIL_EXPORT int hg_request_waitall(int count, hg_request_object_t *request[], unsigned int timeout, unsigned int *flag)
Wait timeout ms for all the specified request to complete.
HG_UTIL_EXPORT int hg_request_complete(hg_request_object_t *request)
Mark the request as completed.
struct hg_request_object hg_request_object_t
HG_UTIL_EXPORT hg_request_class_t * hg_request_init(hg_request_progress_func_t progress, hg_request_trigger_func_t trigger, void *arg)
Initialize the request class with the specific progress/trigger functions that will be called on hg_r...
int(* hg_request_progress_func_t)(unsigned int timeout, void *arg)
Progress callback, arg can be used to pass extra parameters required by underlying API...