#include "pip.h" //! [main] class ObjectA: public PIObject { PIOBJECT(ObjectA) public: EVENT_HANDLER1(void, handlerA, const PIString & , str) {piCoutObj << "handler A:" << str;} EVENT2(eventA2, int, i, float, f); EVENT1(eventA1, const PIString & , str); }; class ObjectB: public PIObject { PIOBJECT(ObjectB) public: EVENT_HANDLER2(void, handlerB, int, i, float, f) {piCoutObj << "handler B:" << i << "," << f;} EVENT1(eventB, PIString, str); }; int main(int argc, char * argv[]) { ObjectA obj_a; ObjectB obj_b; CONNECT2(void, int, float, &obj_a, eventA2, &obj_b, handlerB); obj_a.eventA2(2, 0.5); CONNECT1(void, PIString, &obj_b, eventB, &obj_a, handlerA); obj_b.eventB("event to handler"); CONNECT1(void, PIString, &obj_a, eventA1, &obj_b, eventB); obj_a.eventA1("event to event"); }; //! [main]