本文整理汇总了C++中MpResource::getFlowGraph方法的典型用法代码示例。如果您正苦于以下问题:C++ MpResource::getFlowGraph方法的具体用法?C++ MpResource::getFlowGraph怎么用?C++ MpResource::getFlowGraph使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MpResource
的用法示例。
在下文中一共展示了MpResource::getFlowGraph方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processMessages
// Processes all of the messages currently queued for this flow graph.
// For now, this method always returns OS_SUCCESS.
OsStatus MpFlowGraphBase::processMessages(void)
{
OsWriteLock lock(mRWMutex);
UtlBoolean done;
UtlBoolean handled;
static MpFlowGraphMsg* pStopMsg = NULL;
MpResource* pMsgDest;
OsStatus res;
// First, we send ourselves a FLOWGRAPH_PROCESS_FRAME message.
// This message serves as a "stopper" in the message queue. When we
// handle that message, we know that we have processed all of the messages
// for the flowgraph (and its resources) that had arrived prior to the
// start of this frame processing interval.
if (NULL == pStopMsg) {
pStopMsg = new MpFlowGraphMsg(MpFlowGraphMsg::FLOWGRAPH_PROCESS_FRAME);
pStopMsg->setReusable(TRUE);
}
res = postMessage(*pStopMsg);
assert(res == OS_SUCCESS);
done = FALSE;
while (!done)
{
// get the next message
OsMsg* pMsg ;
res = mMessages.receive(pMsg, OsTime::NO_WAIT);
assert(res == OS_SUCCESS);
if (pMsg->getMsgType() == OsMsg::MP_FLOWGRAPH_MSG)
{
MpFlowGraphMsg* pRcvdMsg = (MpFlowGraphMsg*) pMsg ;
// determine if this message is intended for a resource in the
// flow graph (as opposed to a message for the flow graph itself)
pMsgDest = pRcvdMsg->getMsgDest();
if (pMsgDest != NULL)
{
// deliver the message if the resource is still part of this graph
if (pMsgDest->getFlowGraph() == this)
{
handled = pMsgDest->handleMessage(*pRcvdMsg);
assert(handled);
}
}
else
{
// since pMsgDest is NULL, this msg is intended for the flow graph
switch (pRcvdMsg->getMsg())
{
case MpFlowGraphMsg::FLOWGRAPH_PROCESS_FRAME:
done = TRUE; // "stopper" message encountered -- we are done
break; // processing messages for this frame interval
default:
handled = handleMessage(*pRcvdMsg);
assert(handled);
break;
}
}
pRcvdMsg->releaseMsg(); // free the msg
}
else
{
handled = handleMessage(*pMsg);
assert(handled);
pMsg->releaseMsg() ;
}
}
return OS_SUCCESS;
}