// Common, group Encoding
// Copyright Alexander Liss

#ifndef __DATAHOOK_H__
#define __DATAHOOK_H__

#include "commbuf.h"

	// DataHook - an abstract interface
	// objects, which can pack

struct DataHook
{
virtual ~DataHook(){}
virtual int pack(CommBuffer& d)const=0;
virtual int unpack(const CommBuffer& s,ReadControl& c)=0;
};

int pack(CommBuffer& d,const DataHook& h)
{return h.pack(d);}
int unpack(DataHook& h,const CommBuffer& s,ReadControl& c)
{return h.unpack(s,c);}

#endif