当前位置: 首页>>代码示例>>C++>>正文


C++ MasterCMCommand::getObjectID方法代码示例

本文整理汇总了C++中MasterCMCommand::getObjectID方法的典型用法代码示例。如果您正苦于以下问题:C++ MasterCMCommand::getObjectID方法的具体用法?C++ MasterCMCommand::getObjectID怎么用?C++ MasterCMCommand::getObjectID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MasterCMCommand的用法示例。


在下文中一共展示了MasterCMCommand::getObjectID方法的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;
}
开发者ID:OlafRocket,项目名称:Collage,代码行数:28,代码来源:objectCM.cpp

示例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();
}
开发者ID:rttag,项目名称:Collage,代码行数:8,代码来源:objectCM.cpp

示例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;
}
开发者ID:rttag,项目名称:Collage,代码行数:9,代码来源:objectCM.cpp

示例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;
}
开发者ID:tribal-tec,项目名称:Collage,代码行数:22,代码来源:fullMasterCM.cpp


注:本文中的MasterCMCommand::getObjectID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。