本文整理汇总了C++中uint128_t类的典型用法代码示例。如果您正苦于以下问题:C++ uint128_t类的具体用法?C++ uint128_t怎么用?C++ uint128_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了uint128_t类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: LBLOG
uint128_t VersionedSlaveCM::sync( const uint128_t& v )
{
#if 0
LBLOG( LOG_OBJECTS ) << "sync to v" << v << ", id " << _object->getID()
<< "." << _object->getInstanceID() << std::endl;
#endif
if( _version == v )
return _version;
if( v == VERSION_HEAD )
{
_syncToHead();
return _version;
}
const uint128_t version = ( v == VERSION_NEXT ) ? _version + 1 : v;
LBASSERTINFO( version.high() == 0, "Not a master version: " << version )
LBASSERTINFO( _version <= version,
"can't sync to older version of object " <<
lunchbox::className( _object ) << " " << _object->getID() <<
" (" << _version << ", " << version <<")" );
while( _version < version )
_unpackOneVersion( _queuedVersions.pop( ));
LocalNodePtr node = _object->getLocalNode();
if( node.isValid( ))
node->flushCommands();
return _version;
}
开发者ID:aoighost,项目名称:Equalizer,代码行数:31,代码来源:versionedSlaveCM.cpp
示例2: memory_write
void memory_write(memory_content& content, address const begin, uint128_t value, bool const write_data_in_big_endian)
{
byte* b = value.data();
if (write_data_in_big_endian == is_this_little_endian_machine())
std::reverse(b,b + value.size());
memory_write(content,begin,(byte const*)b,value.size());
}
开发者ID:chubbymaggie,项目名称:Rebours,代码行数:7,代码来源:execution_properties.cpp
示例3: LB_TS_NOT_THREAD
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;
}
开发者ID:sguzwf,项目名称:Collage,代码行数:58,代码来源:objectStore.cpp
示例4: waitRequest
bool RequestHandler::waitRequest( const uint32_t requestID, uint128_t& rUint128,
const uint32_t timeout )
{
Request::Result result;
if( !_impl->waitRequest( requestID, result, timeout ))
return false;
rUint128.high() = result.rUint128.high;
rUint128.low() = result.rUint128.low;
return true;
}
开发者ID:delalond,项目名称:Lunchbox,代码行数:11,代码来源:requestHandler.cpp
示例5: serializeRequest
::zeroeq::Event serializeRequest( const uint128_t& eventType )
{
::zeroeq::Event event( ::zeroeq::vocabulary::EVENT_REQUEST );
flatbuffers::FlatBufferBuilder& fbb = event.getFBB();
RequestBuilder builder( fbb );
builder.add_eventHigh( eventType.high( ));
builder.add_eventLow( eventType.low( ));
fbb.Finish( builder.Finish( ));
return event;
}
开发者ID:favreau,项目名称:zeq,代码行数:12,代码来源:vocabulary.cpp
示例6: LB_TS_NOT_THREAD
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;
}
开发者ID:tribal-tec,项目名称:Collage,代码行数:51,代码来源:objectStore.cpp
示例7: LBASSERTINFO
uint128_t VersionedMasterCM::sync( const uint128_t& inVersion )
{
LBASSERTINFO( inVersion.high() != 0 || inVersion == VERSION_NEXT ||
inVersion == VERSION_HEAD, inVersion );
#if 0
LBLOG( LOG_OBJECTS ) << "sync to v" << inVersion << ", id "
<< _object->getID() << "." << _object->getInstanceID()
<< std::endl;
#endif
if( inVersion == VERSION_NEXT )
return _apply( _slaveCommits.pop( ));
if( inVersion == VERSION_HEAD )
{
uint128_t version = VERSION_NONE;
for( ObjectDataIStream* is = _slaveCommits.tryPop(); is;
is = _slaveCommits.tryPop( ))
{
version = _apply( is );
}
return version;
}
// else apply only concrete slave commit
return _apply( _slaveCommits.pull( inVersion ));
}
开发者ID:jafyvilla,项目名称:Collage,代码行数:27,代码来源:versionedMasterCM.cpp
示例8: serveRequest
void RequestHandler::serveRequest( const uint32_t requestID,
const uint128_t& result )
{
Request* request = 0;
{
ScopedFastWrite mutex( _impl->lock );
RequestHashCIter i = _impl->requests.find( requestID );
if( i != _impl->requests.end( ))
request = i->second;
}
if( request )
{
request->result.rUint128.low = result.low();
request->result.rUint128.high = result.high();
request->lock.unset();
}
}
开发者ID:delalond,项目名称:Lunchbox,代码行数:19,代码来源:requestHandler.cpp
示例9: sync
uint128_t MasterCM::sync( const uint128_t& version )
{
EQASSERTINFO( version.high() != 0 || version == VERSION_NEXT ||
version == VERSION_HEAD, version );
#if 0
EQLOG( LOG_OBJECTS ) << "sync to v" << version << ", id "
<< _object->getID() << "." << _object->getInstanceID()
<< std::endl;
#endif
if( version == VERSION_NEXT )
{
ObjectDataIStream* is = _queuedDeltas.pop();
_apply( is );
return _version;
}
// else
if( version == VERSION_HEAD )
{
ObjectDataIStream* is = 0;
while( _queuedDeltas.tryPop( is ))
_apply( is );
return _version;
}
// else apply only concrete slave commit
ObjectDataIStream* is = 0;
ObjectDataIStreams unusedStreams;
while( !is )
{
ObjectDataIStream* candidate = _queuedDeltas.pop();
if( candidate->getVersion() == version )
is = candidate;
else
unusedStreams.push_back( candidate );
}
_apply( is );
_queuedDeltas.pushFront( unusedStreams );
return version;
}
开发者ID:cstalder,项目名称:Equalizer,代码行数:41,代码来源:masterCM.cpp
示例10:
// Bitwise Operators
template <typename T> T operator&(T lhs, uint128_t rhs){
T out = lhs & (T) rhs.lower();
return out;
}
开发者ID:jiffe,项目名称:focalcoin,代码行数:5,代码来源:uint128.cpp
示例11: return
// Comparison Operators
template <typename T> bool operator==(T lhs, uint128_t rhs){
return (!rhs.upper() && ((uint64_t) lhs == rhs.lower()));
}
开发者ID:jiffe,项目名称:focalcoin,代码行数:4,代码来源:uint128.cpp
示例12: toJSON
template<> ZEROBUF_INL void toJSON( const uint128_t& value, Json::Value& json )
{
json[ "high" ] = Json::UInt64( value.high( ));
json[ "low" ] = Json::UInt64( value.low( ));
}
开发者ID:HBPVIS,项目名称:ZeroBuf,代码行数:5,代码来源:json.cpp
注:本文中的uint128_t类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论