#include "pip.h"
enum Header {
	hInt = 1,
	hString,
	hVoid
};

class MyObj: public PIObject {
	PIOBJECT(MyObj);
public:
	EVENT_HANDLER1(void, methodI, int, i) {piCout << "methodI" << i;}
	EVENT_HANDLER1(void, methodS, PIString, s) {piCout << "methodS" << s;}
	EVENT_HANDLER0(void, method) {piCout << "method";}
};

int main() {
	MyObj o;
	PIParseHelper<int> parser(&o);

	parser.assign(hInt, o.HANDLER(methodI));
	parser.assign(hString, o.HANDLER(methodS));
	parser.assign(hVoid, o.HANDLER(method));

	PIByteArray data;

	data.clear();
	data << 11;
	parser.parse(hInt, data);
	// methodI 11

	data.clear();
	data << PIString("text");
	parser.parse(hString, data);
	// methodS text

	data.clear();
	parser.parse(hVoid, data);
	// method
}
