#include #include using namespace ff; class Stage1: public ff_node { public: void * svc(void * task) { std::cout << "Hello " << std::endl; char * p = (char *) calloc(sizeof(char),10); strcpy(p,"World"); sleep(1); return ((void *)p); } }; class Stage2: public ff_node { public: void * svc(void * task) { std::cout << ((char *)task) << std::endl; free(task); return GO_ON; } }; int main(int argc, char * argv[]) { ff_pipeline pipe; pipe.add_stage(new Stage1()); pipe.add_stage(new Stage2()); if (pipe.run_and_wait_end()<0) { error("running pipeline\n"); return -1; } return 0; }