completion.h 979 Bytes
Newer Older
Matthieu Dorier's avatar
Matthieu Dorier committed
1 2 3 4 5 6 7 8
/*
 * (C) 2017 The University of Chicago
 * 
 * See COPYRIGHT in top-level directory.
 */
#ifndef __MOBJECT_COMPLETION_H
#define __MOBJECT_COMPLETION_H

Matthieu Dorier's avatar
Matthieu Dorier committed
9
#include <margo.h>
Matthieu Dorier's avatar
Matthieu Dorier committed
10 11
#include "mobject-store-config.h"

Matthieu Dorier's avatar
Matthieu Dorier committed
12 13 14 15 16 17 18 19 20
/**
 * The mobject_store_completion object is used for asynchronous
 * functions. It contains the callbacks to call when the data is
 * safe and when the operation has completed, as well as potential
 * user data and required mechanism to be able to block on the
 * completion object.
 * mobject_store_completion* is typedef-ed as mobject_store_completion_t
 * in libmobject-store.h.
 */
Matthieu Dorier's avatar
Matthieu Dorier committed
21 22 23 24
struct mobject_store_completion {
	mobject_store_callback_t cb_complete;    // completion callback
	mobject_store_callback_t cb_safe;        // safe callback
	void*                    cb_arg;         // arguments for callbacks
Matthieu Dorier's avatar
Matthieu Dorier committed
25
	margo_request            request;        // margo request to wait on
Matthieu Dorier's avatar
Matthieu Dorier committed
26
	int                      ret_value;      // return value of the operation
Matthieu Dorier's avatar
Matthieu Dorier committed
27 28 29 30
};

#endif