Mercury
mercury_types.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_TYPES_H
12 #define MERCURY_TYPES_H
13 
14 #include "na.h"
15 #include "mercury_config.h"
16 
17 typedef hg_uint32_t hg_id_t; /* Operation ID of the operation */
18 typedef hg_bool_t hg_status_t; /* Status of the operation */
19 typedef hg_int32_t hg_error_t; /* Error code */
20 typedef void * hg_request_t; /* Abstract request */
21 typedef void * hg_proc_t; /* Abstract serialization processor */
22 typedef void * hg_handle_t; /* Abstract RPC handle */
23 typedef void * hg_bulk_t; /* Abstract bulk data handle */
24 typedef void * hg_bulk_request_t;/* Bulk request object */
25 
26 typedef enum {
29 } hg_bulk_op_t;
30 
31 #define HG_BULK_READWRITE NA_MEM_READWRITE
32 #define HG_BULK_READ_ONLY NA_MEM_READ_ONLY
33 #define HG_BULK_WRITE_ONLY NA_MEM_READWRITE
34 
35 #define HG_STATUS_IGNORE ((hg_status_t *)1)
36 
37 #define HG_MAX_IDLE_TIME NA_MAX_IDLE_TIME
38 
39 #define HG_REQUEST_NULL ((hg_request_t)0)
40 #define HG_PROC_NULL ((hg_proc_t)0)
41 #define HG_HANDLE_NULL ((hg_handle_t)0)
42 #define HG_BULK_NULL ((hg_bulk_t)0)
43 #define HG_BULK_REQUEST_NULL ((hg_bulk_request_t)0)
44 
50 typedef enum {
54 } hg_proc_op_t;
55 
59 typedef enum {
64 
65 /* Error return codes:
66  * Functions return 0 for success or -HG_XXX_ERROR for failure */
67 typedef enum hg_return {
68  HG_FAIL = -1, /* default (TODO keep until switch to new error format) */
70  HG_NA_ERROR, /* error in NA layer */
71  HG_TIMEOUT, /* reached timeout */
72  HG_INVALID_PARAM, /* invalid parameter */
73  HG_SIZE_ERROR, /* size error */
74  HG_NOMEM_ERROR, /* no memory error */
75  HG_PROTOCOL_ERROR, /* protocol does not match */
76  HG_NO_MATCH, /* no function match */
77  HG_CHECKSUM_ERROR /* checksum error */
78 } hg_return_t;
79 
80 /* Proc callback for serializing/deserializing parameters */
81 typedef hg_return_t (*hg_proc_cb_t)(hg_proc_t proc, void *in_struct);
82 
83 /* Callback for executing RPC */
84 typedef hg_return_t (*hg_rpc_cb_t)(hg_handle_t handle);
85 
86 /* Context used for request emulation */
87 struct hg_context {
90 };
91 
92 #endif /* MERCURY_TYPES_H */
void * hg_bulk_request_t
Definition: mercury_types.h:24
na_context_t * na_context
Definition: mercury_types.h:89
void * hg_bulk_t
Definition: mercury_types.h:23
hg_int32_t hg_error_t
Definition: mercury_types.h:19
hg_uint32_t hg_id_t
Definition: mercury_types.h:17
na_class_t * na_class
Definition: mercury_types.h:88
hg_bulk_op_t
Definition: mercury_types.h:26
void * hg_handle_t
Definition: mercury_types.h:22
void * hg_proc_t
Definition: mercury_types.h:21
hg_proc_hash_t
Hash methods available for proc.
Definition: mercury_types.h:59
hg_return_t(* hg_rpc_cb_t)(hg_handle_t handle)
Definition: mercury_types.h:84
hg_proc_op_t
Proc operations.
Definition: mercury_types.h:50
enum hg_return hg_return_t
void * hg_request_t
Definition: mercury_types.h:20
hg_bool_t hg_status_t
Definition: mercury_types.h:18
hg_return
Definition: mercury_types.h:67
hg_return_t(* hg_proc_cb_t)(hg_proc_t proc, void *in_struct)
Definition: mercury_types.h:81