本文整理汇总了C++中MasterCMCommand::getRequestID方法的典型用法代码示例。如果您正苦于以下问题:C++ MasterCMCommand::getRequestID方法的具体用法?C++ MasterCMCommand::getRequestID怎么用?C++ MasterCMCommand::getRequestID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MasterCMCommand
的用法示例。
在下文中一共展示了MasterCMCommand::getRequestID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sendSync
bool ObjectCM::sendSync( const MasterCMCommand& command )
{
lunchbox::ScopedFastWrite mutex( _lock );
if( !_object )
{
LBWARN << "Sync from detached object requested" << std::endl;
return false;
}
const uint128_t& maxCachedVersion = command.getMaxCachedVersion();
const bool useCache =
command.useCache() &&
command.getMasterInstanceID() == _object->getInstanceID() &&
maxCachedVersion == getVersion();
if( !useCache )
{
ObjectInstanceDataOStream os( this );
os.enableSync( getVersion(), command );
_object->getInstanceData( os );
os.disable();
}
NodePtr node = command.getNode();
node->send( CMD_NODE_SYNC_OBJECT_REPLY, useCache /*preferMulticast*/ )
<< node->getNodeID() << command.getObjectID() << command.getRequestID()
<< true << command.useCache() << useCache;
return true;
}
示例2: _sendMapSuccess
void ObjectCM::_sendMapSuccess( const MasterCMCommand& command,
const bool multicast )
{
command.getNode()->send( CMD_NODE_MAP_OBJECT_SUCCESS, multicast )
<< command.getNode()->getNodeID() << command.getObjectID()
<< command.getRequestID() << command.getInstanceID()
<< _object->getChangeType() << _object->getInstanceID();
}
示例3: _sendMapReply
void ObjectCM::_sendMapReply( const MasterCMCommand& command,
const uint128_t& version, const bool result,
const bool useCache, const bool multicast )
{
command.getNode()->send( CMD_NODE_MAP_OBJECT_REPLY, multicast )
<< command.getNode()->getNodeID() << command.getObjectID()
<< version << command.getRequestID() << result
<< command.useCache() << useCache;
}
示例4: sendSync
bool FullMasterCM::sendSync( const MasterCMCommand& command )
{
//const uint128_t& version = command.getRequestedVersion();
const uint128_t& maxCachedVersion = command.getMaxCachedVersion();
const bool useCache =
command.useCache() &&
command.getMasterInstanceID() == _object->getInstanceID() &&
maxCachedVersion == _version;
if( !useCache )
{
Mutex mutex( _slaves );
InstanceData* instanceData = _instanceDatas.back();
instanceData->os.sync( command );
}
NodePtr node = command.getNode();
node->send( CMD_NODE_SYNC_OBJECT_REPLY, useCache /*preferMulticast*/ )
<< node->getNodeID() << command.getObjectID() << command.getRequestID()
<< true << command.useCache() << useCache;
return true;
}