本文整理汇总了C++中uint128_t::isUUID方法的典型用法代码示例。如果您正苦于以下问题:C++ uint128_t::isUUID方法的具体用法?C++ uint128_t::isUUID怎么用?C++ uint128_t::isUUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uint128_t
的用法示例。
在下文中一共展示了uint128_t::isUUID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _startSync
uint32_t ObjectStore::_startSync( Object* object, NodePtr master,
const uint128_t& id,
const uint32_t instanceID )
{
LB_TS_NOT_THREAD( _receiverThread );
LBLOG( LOG_OBJECTS )
<< "Syncing " << lunchbox::className( object ) << " with id " << id
<< std::endl;
LBASSERT( object );
LBASSERTINFO( id.isUUID(), id );
if( !object || !id.isUUID( ))
{
LBWARN << "Invalid object " << object << " or id " << id << std::endl;
return LB_UNDEFINED_UINT32;
}
if( !master )
master = _localNode->connectObjectMaster( id );
if( !master || !master->isReachable( ))
{
LBWARN << "Mapping of object " << id << " failed, invalid master node"
<< std::endl;
return LB_UNDEFINED_UINT32;
}
const uint32_t request =
_localNode->registerRequest( new ObjectDataIStream );
uint128_t minCachedVersion = VERSION_HEAD;
uint128_t maxCachedVersion = VERSION_NONE;
uint32_t cacheInstanceID = 0;
bool useCache = _checkInstanceCache( id, minCachedVersion, maxCachedVersion,
cacheInstanceID );
if( useCache )
{
switch( instanceID )
{
case CO_INSTANCE_ALL:
break;
default:
if( instanceID == cacheInstanceID )
break;
useCache = false;
LBCHECK( _instanceCache->release( id, 1 ));
break;
}
}
// Use stream expected by MasterCMCommand
master->send( CMD_NODE_SYNC_OBJECT )
<< VERSION_NEWEST << minCachedVersion << maxCachedVersion << id
<< uint64_t(0) /* maxVersions */ << request << instanceID
<< cacheInstanceID << useCache;
return request;
}
示例2: mapNB
uint32_t ObjectStore::mapNB( Object* object, const uint128_t& id,
const uint128_t& version, NodePtr master )
{
LB_TS_NOT_THREAD( _receiverThread );
LBLOG( LOG_OBJECTS )
<< "Mapping " << lunchbox::className( object ) << " to id " << id
<< " version " << version << std::endl;
LBASSERT( object );
LBASSERTINFO( id.isUUID(), id );
if( !master )
master = _localNode->connectObjectMaster( id );
if( !master || !master->isReachable( ))
{
LBWARN << "Mapping of object " << id << " failed, invalid master node"
<< std::endl;
return LB_UNDEFINED_UINT32;
}
if( !object || !id.isUUID( ))
{
LBWARN << "Invalid object " << object << " or id " << id << std::endl;
return LB_UNDEFINED_UINT32;
}
const bool isAttached = object->isAttached();
const bool isMaster = object->isMaster();
LBASSERTINFO( !isAttached, *object );
LBASSERT( !isMaster ) ;
if( isAttached || isMaster )
{
LBWARN << "Invalid object state: attached " << isAttached << " master "
<< isMaster << std::endl;
return LB_UNDEFINED_UINT32;
}
const uint32_t request = _localNode->registerRequest( object );
uint128_t minCachedVersion = VERSION_HEAD;
uint128_t maxCachedVersion = VERSION_NONE;
uint32_t masterInstanceID = 0;
const bool useCache = _checkInstanceCache( id, minCachedVersion,
maxCachedVersion,
masterInstanceID );
object->notifyAttach();
master->send( CMD_NODE_MAP_OBJECT )
<< version << minCachedVersion << maxCachedVersion << id
<< object->getMaxVersions() << request << _genNextID( _instanceIDs )
<< masterInstanceID << useCache;
return request;
}