本文整理汇总了C++中Msg_p::hasCopyTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Msg_p::hasCopyTo方法的具体用法?C++ Msg_p::hasCopyTo怎么用?C++ Msg_p::hasCopyTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Msg_p
的用法示例。
在下文中一共展示了Msg_p::hasCopyTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _dispatchQueued
void MsgRouter::_dispatchQueued()
{
while( !m_msgQueue.empty() )
{
Msg_p pMsg = m_msgQueue.front();
m_insertPos = m_msgQueue.begin()+1; // Insert position set to right after current event.
do
{
if( pMsg->hasCopyTo() )
pMsg->getCopyTo()->receive( pMsg );
if( pMsg->hasSource() )
_dispatchToSourceRoutes( pMsg );
_dispatchToTypeRoutes( pMsg );
_broadcast( pMsg );
}
while( pMsg->doRepost() );
m_msgQueue.pop_front();
}
m_insertPos = m_msgQueue.begin(); // Insert position set right to start.
}
示例2: _formatCopyTo
string MsgLogger::_formatCopyTo( const Msg_p& _pMsg ) const
{
std::string out;
if( _pMsg->hasCopyTo() )
{
char temp[64];
Receiver * pCopyTo = _pMsg->getCopyTo().rawPtr();
const char * pType = pCopyTo->className();
sprintf( temp, " copyTo=%p (%s)", pCopyTo, pType );
out = temp;
}
return out;
}
示例3: _finalizeMsg
void MsgRouter::_finalizeMsg( const Msg_p& pMsg )
{
// Fill in missing information in the event-class.
pMsg->m_timestamp = m_time;
pMsg->m_modKeys = m_modKeys;
// Only global POINTER_ENTER & POINTER_MOVE events have these members
// set, the rest needs to have them filled in.
if( pMsg->hasCopyTo() || (pMsg->type() != WG_MSG_MOUSE_MOVE && pMsg->type() != WG_MSG_MOUSE_ENTER) )
{
pMsg->m_pointerPos = m_pointerPos;
}
// Msg specific finalizations
switch( pMsg->type() )
{
// Key events need translation of keycodes.
case WG_MSG_KEY_PRESS:
case WG_MSG_KEY_RELEASE:
case WG_MSG_KEY_REPEAT:
{
KeyMsg* p = static_cast<KeyMsg*>(pMsg.rawPtr());
p->m_translatedKeyCode = Base::translateKey(p->m_nativeKeyCode);
}
break;
default:
break;
}
}