stasis-bLSM/tuplemerger.h
sears 632afe6d9c cleanup statistics gathering and reporting.
constify inputs to merge functions (so they can't call freetuple())


git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@662 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe
2010-03-05 19:07:47 +00:00

33 lines
529 B
C++

#ifndef _TUPLE_MERGER_H_
#define _TUPLE_MERGER_H_
struct datatuple;
typedef datatuple* (*merge_fn_t) (const datatuple*, const datatuple *);
datatuple* append_merger(const datatuple *t1, const datatuple *t2);
datatuple* replace_merger(const datatuple *t1, const datatuple *t2);
class tuplemerger
{
public:
tuplemerger(merge_fn_t merge_fp)
{
this->merge_fp = merge_fp;
}
datatuple* merge(const datatuple *t1, const datatuple *t2);
private:
merge_fn_t merge_fp;
};
#endif