/************************************************************************** ** MBUSMSGHANDLER -- Standard client application message handler. ** */ int mbusMsgHandler (int fd, void *data) { char *host = NULL, *msg = NULL; int from_tid, to_tid, subject; int mytid = mbAppGet (APP_TID); to_tid = subject = -1; if (mbusRecv (&from_tid, &to_tid, &subject, &host, &msg) < 0) { if (console) fprintf (stderr, "Error in mbusRecv()\n"); if (host) free ((void *) host); if (msg) free ((void *) msg); return (ERR); } /* See if message was meant specifically for me.... */ if (to_tid == mytid && subject != MB_ERR) { if (console) fprintf (stderr, "SENDTO: from:%d subj:%d msg='%s'\n", from_tid, subject, msg); myHandler (from_tid, subject, msg); } else if (to_tid < 0) { if (console && strcmp (msg, "no-op") != 0) fprintf (stderr, "BCAST: from:%d subj:%d msg='%s'\n", from_tid, subject, msg); myHandler (from_tid, subject, msg); } else { if (console) { printf("Monitor...\n"); printf(" from:%d\n to:%d\n subj:%d\n", from_tid, to_tid, subject); printf(" host:'%s'\n msg='%s'\n", host, msg); } } if (host) free ((void *) host); if (msg) free ((void *) msg); return (OK); }
QObject* QTuioPlugin::create(const QString& key, const QString& spec) { if (!key.compare(QLatin1String("TuioTouch"), Qt::CaseInsensitive)) { QScopedPointer<QTuioTouchScreenHandler> myHandler(new QTuioTouchScreenHandler(spec)); myHandler->start(); return myHandler.take(); } return 0; }
object *DepManager2::handleRequest(RequestModel *request) { if(PreFeeRequestModel::FEE_TYPE.equals(request->getType())) { //表示预支差旅费用申请 return myHandler(request); } else { //其他的让父类去处理 return DepManager::handleRequest(request); } }