write-op-visitor.h 1.04 KB
Newer Older
1 2 3 4 5 6 7 8 9
/*
 * (C) 2017 The University of Chicago
 * 
 * See COPYRIGHT in top-level directory.
 */
#ifndef __MOBJECT_WRITE_OP_VISITOR_H
#define __MOBJECT_WRITE_OP_VISITOR_H

#include "libmobject-store.h"
Matthieu Dorier's avatar
Matthieu Dorier committed
10
#include "src/util/buffer-union.h"
11

12 13 14 15
#ifdef __cplusplus
extern "C" {
#endif

16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
typedef struct write_op_visitor {
	void (*visit_begin)(void*);
	void (*visit_create)(void*, int);
	void (*visit_write)(void*, buffer_u, size_t, uint64_t);
	void (*visit_write_full)(void*, buffer_u, size_t);
	void (*visit_writesame)(void*, buffer_u, size_t, size_t, uint64_t);
	void (*visit_append)(void*, buffer_u, size_t);
	void (*visit_remove)(void*);
	void (*visit_truncate)(void*, uint64_t);
	void (*visit_zero)(void*, uint64_t, uint64_t);
	void (*visit_omap_set)(void*, char const* const*, char const* const*, const size_t*, size_t);
	void (*visit_omap_rm_keys)(void*, char const* const*, size_t);
	void (*visit_end)(void*);
}* write_op_visitor_t;

31
void execute_write_op_visitor(write_op_visitor_t visitor, mobject_store_write_op_t write_op, void* uargs);
32

33 34 35 36
#ifdef __cplusplus
}
#endif

37
#endif