write-op-visitor.h 992 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/*
 * (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"
#include "buffer-union.h"

typedef struct write_op_visitor {
	void* uargs;
	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;

void execute_write_op_visitor(write_op_visitor_t visitor, mobject_store_write_op_t write_op);

#endif