本文整理汇总了C++中uint128_t::high方法的典型用法代码示例。如果您正苦于以下问题:C++ uint128_t::high方法的具体用法?C++ uint128_t::high怎么用?C++ uint128_t::high使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uint128_t
的用法示例。
在下文中一共展示了uint128_t::high方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sync
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;
}
示例2: sync
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 ));
}
示例3: 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;
}
示例4: builder
::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;
}
示例5: 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();
}
}
示例6: 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;
}
示例7: 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( ));
}