• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LBASSERTINFO函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LBASSERTINFO函数的典型用法代码示例。如果您正苦于以下问题:C++ LBASSERTINFO函数的具体用法?C++ LBASSERTINFO怎么用?C++ LBASSERTINFO使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LBASSERTINFO函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: LB_TS_THREAD

void ObjectDataIStream::addDataPacket( Command& command )
{
    LB_TS_THREAD( _thread );
    LBASSERT( !isReady( ));

    const ObjectDataPacket* packet = command.get< ObjectDataPacket >();
#ifndef NDEBUG
    if( _commands.empty( ))
    {
        LBASSERTINFO( packet->sequence == 0, packet );
    }
    else
    {
        const ObjectDataPacket* previous = 
            _commands.back()->get< ObjectDataPacket >();
        LBASSERTINFO( packet->sequence == previous->sequence+1, 
                      packet->sequence << ", " << previous->sequence );
        LBASSERT( packet->version == previous->version );
    }
#endif

    command.retain();
    _commands.push_back( &command );
    if( packet->last )
        _setReady();
}
开发者ID:aoighost,项目名称:Equalizer,代码行数:26,代码来源:objectDataIStream.cpp


示例2: LB_TS_THREAD

void ObjectDataIStream::addDataCommand( ObjectDataICommand command )
{
    LB_TS_THREAD( _thread );
    LBASSERT( !isReady( ));

#ifndef NDEBUG
    const uint128_t& version = command.getVersion();
    const uint32_t sequence = command.getSequence();

    if( _commands.empty( ))
    {
        LBASSERTINFO( sequence == 0, sequence << " in " << command );
    }
    else
    {
        ObjectDataICommand previous( _commands.back() );
        const uint128_t& previousVersion = previous.getVersion();
        const uint32_t previousSequence = previous.getSequence();
        LBASSERTINFO( sequence == previousSequence+1,
                      sequence << ", " << previousSequence );
        LBASSERT( version == previousVersion );
    }
#endif

    _commands.push_back( command );
    if( command.isLast( ))
        _setReady();
}
开发者ID:4Second2None,项目名称:Collage,代码行数:28,代码来源:objectDataIStream.cpp


示例3: 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


示例4: LBASSERT

void VersionedSlaveCM::_unpackOneVersion( ObjectDataIStream* is )
{
    LBASSERT( is );
    LBASSERTINFO( _version == is->getVersion() - 1, "Expected version " 
                  << _version + 1 << ", got " << is->getVersion() << " for "
                  << *_object );

    if( is->hasInstanceData( ))
        _object->applyInstanceData( *is );
    else
        _object->unpack( *is );

    _version = is->getVersion();
    _sendAck();

    LBASSERT( _version != VERSION_INVALID );
    LBASSERT( _version != VERSION_NONE );
    LBASSERTINFO( is->getRemainingBufferSize()==0 && is->nRemainingBuffers()==0,
                  "Object " << typeid( *_object ).name() <<
                  " did not unpack all data" );

#if 0
    LBLOG( LOG_OBJECTS ) << "applied v" << _version << ", id "
                         << _object->getID() << "." << _object->getInstanceID()
                         << std::endl;
#endif
    _releaseStream( is );
}
开发者ID:aoighost,项目名称:Equalizer,代码行数:28,代码来源:versionedSlaveCM.cpp


示例5: LBASSERT

void FullMasterCM::_checkConsistency() const
{
#ifndef NDEBUG
    LBASSERT( !_instanceDatas.empty( ));
    LBASSERT( _object->isAttached() );

    if( _version == VERSION_NONE )
        return;

    uint128_t version = _version;
    for( InstanceDataDeque::const_reverse_iterator i = _instanceDatas.rbegin();
         i != _instanceDatas.rend(); ++i )
    {
        const InstanceData* data = *i;
        LBASSERT( data->os.getVersion() != VERSION_NONE );
        LBASSERTINFO( data->os.getVersion() == version,
                      data->os.getVersion() << " != " << version );
        if( data != _instanceDatas.front( ))
        {
            LBASSERTINFO( data->commitCount + _nVersions >= _commitCount,
                          data->commitCount << ", " << _commitCount << " [" <<
                          _nVersions << "]" );
        }
        --version;
    }
#endif
}
开发者ID:tribal-tec,项目名称:Collage,代码行数:27,代码来源:fullMasterCM.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: LB_TS_SCOPED

BufferPtr BufferCache::alloc( const uint64_t size )
{
    LB_TS_SCOPED( _thread );
    LBASSERTINFO( size >= COMMAND_ALLOCSIZE, size );
    LBASSERTINFO( size < LB_BIT48,
                  "Out-of-sync network stream: buffer size " << size << "?" );

    BufferPtr buffer = _impl->newBuffer();
    LBASSERT( buffer->getRefCount() == 1 );

    buffer->reserve( size );
    buffer->resize( 0 );
    return buffer;
}
开发者ID:4Second2None,项目名称:Collage,代码行数:14,代码来源:bufferCache.cpp


示例8: LBASSERT

Referenced::~Referenced()
{
    LBASSERT( !_hasBeenDeleted );
    _hasBeenDeleted = true;
    LBASSERTINFO( _refCount == 0,
        "Deleting object with ref count " << _refCount );
}
开发者ID:VMML,项目名称:Lunchbox,代码行数:7,代码来源:referenced.cpp


示例9: LBASSERT

uint128_t& uint128_t::operator = ( const std::string& from )
{
    if( from.empty( ))
    {
        _high = 0;
        _low = 0;
        return *this;
    }

    char* next = 0;
    _high = ::strtoull( from.c_str(), &next, 16 );
    LBASSERT( next != from.c_str( ));

    if( *next == '\0' ) // short representation, high was 0
    {
        _low = _high;
        _high = 0;
    }
    else
    {
        if( strncmp( next, "\\058" /* utf-8 ':' */, 4 ) == 0 )
            next += 4;
        else
        {
            LBASSERTINFO( *next == ':', from << ", " << next );
            ++next;
        }
        _low = ::strtoull( next, 0, 16 );
    }
    return *this;
}
开发者ID:ferol,项目名称:Lunchbox,代码行数:31,代码来源:uint128_t.cpp


示例10: LB_TS_THREAD

bool DataIStreamQueue::addDataPacket( const uint128_t& key, Command& command )
{
    LB_TS_THREAD( _thread );
    LBASSERTINFO( _pending.size() < 100, "More than 100 pending commits");

    ObjectDataIStream* istream = 0;
    PendingStreams::iterator i = _pending.find( key );
    if( i == _pending.end( ))
        istream = _iStreamCache.alloc();
    else
        istream = i->second;

    istream->addDataPacket( command );
    if( istream->isReady( ))
    {
        if( i != _pending.end( ))
            _pending.erase( i );

        _queued.push( QueuedStream( key, istream ));
        //LBLOG( LOG_OBJECTS ) << "Queued commit " << key << std::endl;
        return true;
    }

    if( i == _pending.end( ))
    {
        _pending[ key ] = istream;
        //LBLOG( LOG_OBJECTS ) << "New incomplete commit " << key << std::endl;
        return false;
    }

    //LBLOG(LOG_OBJECTS) << "Add data to incomplete commit " << key <<std::endl;
    return false;
}
开发者ID:aoighost,项目名称:Equalizer,代码行数:33,代码来源:dataIStreamQueue.cpp


示例11: LB_TS_THREAD

bool DataIStreamQueue::addDataCommand(const uint128_t& key, ICommand& command)
{
    LB_TS_THREAD(_thread);
    LBASSERTINFO(_pending.size() < 100, "More than 100 pending commits");

    ObjectDataIStream* is = 0;
    PendingStreams::iterator i = _pending.find(key);
    if (i == _pending.end())
        is = _iStreamCache.alloc();
    else
        is = i->second;

    is->addDataCommand(command);
    if (is->isReady())
    {
        if (i != _pending.end())
            _pending.erase(i);

        _queued.push(QueuedStream(key, is));
        return true;
    }

    if (i == _pending.end())
    {
        _pending[key] = is;
        return false;
    }

    return false;
}
开发者ID:Eyescale,项目名称:Collage,代码行数:30,代码来源:dataIStreamQueue.cpp


示例12: LBASSERTINFO

void FrameData::setVersion( const uint64_t version )
{
    LBASSERTINFO( _impl->version <= version, _impl->version << " > "
                                                            << version );
    _impl->version = version;
    LBLOG( LOG_ASSEMBLY ) << "New v" << version << std::endl;
}
开发者ID:sepehr-laal,项目名称:Equalizer,代码行数:7,代码来源:frameData.cpp


示例13: compound

void MonitorEqualizer::_updateZoomAndOffset()
{
    const Compound* compound( getCompound( ));
    const PixelViewport& pvp( compound->getInheritPixelViewport( ));

    const Frames& inputFrames( compound->getInputFrames( ));
    const size_t size( inputFrames.size( ));
    LBASSERTINFO( size == _outputFrames.size(),
                  size << " != " << _outputFrames.size( ));
    LBASSERT( size == _viewports.size( ));

    for( size_t i = 0; i < size; ++i )
    {
        Frame* frame = inputFrames[ i ];
        Frame* outputFrame = _outputFrames[ i ];
        if( !outputFrame )
            continue;

        const Compound* srcCompound = outputFrame->getCompound();
        const Viewport& viewport = _viewports[ i ];

        // compute and apply input frame offset
        const int32_t offsetX = int32_t( float( pvp.w ) * viewport.x );
        const int32_t offsetY = int32_t( float( pvp.h ) * viewport.y );
        frame->setNativeOffset( Vector2i( offsetX, offsetY ));

        // compute and apply output frame zoom
        const int32_t width   = int32_t( float( pvp.w ) * viewport.w );
        const int32_t height  = int32_t( float( pvp.h ) * viewport.h ) ;
        const PixelViewport& srcPVP( srcCompound->getInheritPixelViewport( ));
        const Zoom zoom( float( width ) / float( srcPVP.w ),
                         float( height ) / float( srcPVP.h ));
        outputFrame->setNativeZoom( zoom );
    }
}
开发者ID:BillTheBest,项目名称:Equalizer,代码行数:35,代码来源:monitorEqualizer.cpp


示例14: LBASSERT

void ROITracker::updateDelay( const PixelViewports& pvps,
                              const uint8_t* ticket )
{
    LBASSERT( _needsUpdate );
    LBASSERTINFO( ticket == _ticket, "Wrong ticket" );

    if( ticket != _ticket )
    {
        LBERROR << "Wrong ticket" << std::endl;
        return;
    }

    uint32_t totalAreaFound = 0;
    for( uint32_t i = 0; i < pvps.size(); i++ )
        totalAreaFound += pvps[ i ].getArea();

    Area& area = (*_curFrame)[ _lastStage ].areas.back();
    if( totalAreaFound < area.pvp.getArea()*4/5 )
    {
        // ROI cutted enough, reset failure statistics
        area.lastSkip = 0;
    }else
    {
        // disable ROI for next frames, if it was failing before, 
        // increase number of frames to skip
        area.lastSkip = LB_MIN( area.lastSkip*2 + 1, 64 );
        area.skip     = area.lastSkip;
    }
    _needsUpdate = false;
}
开发者ID:Angels-group,项目名称:Equalizer,代码行数:30,代码来源:roiTracker.cpp


示例15: 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


示例16: LBASSERTINFO

bool Node::removeConnectionDescription( ConnectionDescriptionPtr cd )
{
    LBASSERTINFO( isClosed(), *this );
    if( !isClosed( ))
        return false;
    return _removeConnectionDescription( cd );
}
开发者ID:iCollage,项目名称:Collage,代码行数:7,代码来源:node.cpp


示例17: LBASSERTINFO

void LoadEqualizer::_assign( Compound* compound, const Viewport& vp,
                             const Range& range )
{
    LBASSERTINFO( vp == Viewport::FULL || range == Range::ALL,
                  "Mixed 2D/DB load-balancing not implemented" );

    compound->setViewport( vp );
    compound->setRange( range );
    LBLOG( LOG_LB2 ) << compound->getChannel()->getName() << " set " << vp
                     << ", " << range << std::endl;

    if( getDamping() >= 1.f )
        return;

    // save data for later use
    Data data;
    data.vp      = vp;
    data.range   = range;
    data.channel = compound->getChannel();
    data.taskID  = compound->getTaskID();

    const Compound* destCompound = getCompound();
    if( destCompound->getChannel() == compound->getChannel( ))
        data.destTaskID  = destCompound->getTaskID();

    LBASSERT( data.taskID > 0 );

    if( !vp.hasArea() || !range.hasData( )) // will not render
        data.time = 0;

    LBFrameData& frameData = _history.back();
    LBDatas& items = frameData.second;

    items.push_back( data );
}
开发者ID:TwilitProgrammer,项目名称:Equalizer,代码行数:35,代码来源:loadEqualizer.cpp


示例18: LB_TS_THREAD

bool Node::_cmdFrameStart( co::Command& command )
{
    LB_TS_THREAD( _nodeThread );
    const NodeFrameStartPacket* packet = 
        command.get<NodeFrameStartPacket>();
    LBVERB << "handle node frame start " << packet << std::endl;

    const uint32_t frameNumber = packet->frameNumber;
    LBASSERT( _currentFrame == frameNumber-1 );

    LBLOG( LOG_TASKS ) << "----- Begin Frame ----- " << frameNumber
                       << std::endl;

    Config* config = getConfig();
    
    if( packet->configVersion != co::VERSION_INVALID )
        config->sync( packet->configVersion );
    sync( packet->version );

    config->_frameStart();
    frameStart( packet->frameID, frameNumber );

    LBASSERTINFO( _currentFrame >= frameNumber, 
                  "Node::frameStart() did not start frame " << frameNumber );
    return true;
}
开发者ID:aoighost,项目名称:Equalizer,代码行数:26,代码来源:node.cpp


示例19: LB_TS_THREAD

bool Node::_cmdFrameStart( co::ICommand& cmd )
{
    LB_TS_THREAD( _nodeThread );

    co::ObjectICommand command( cmd );
    const uint128_t& version = command.read< uint128_t >();
    const uint128_t& configVersion = command.read< uint128_t >();
    const uint128_t& frameID = command.read< uint128_t >();
    const uint32_t frameNumber = command.read< uint32_t >();

    LBVERB << "handle node frame start " << command << " frame " << frameNumber
           << " id " << frameID << std::endl;

    LBASSERT( _impl->currentFrame == frameNumber-1 );

    LBLOG( LOG_TASKS ) << "----- Begin Frame ----- " << frameNumber
                       << std::endl;

    Config* config = getConfig();

    if( configVersion != co::VERSION_INVALID )
        config->sync( configVersion );
    sync( version );

    config->_frameStart();
    frameStart( frameID, frameNumber );

    LBASSERTINFO( _impl->currentFrame >= frameNumber,
                  "Node::frameStart() did not start frame " << frameNumber );
    return true;
}
开发者ID:VMML,项目名称:Equalizer,代码行数:31,代码来源:node.cpp


示例20: LBASSERT

void ObjectStore::_attach( Object* object, const uint128_t& id,
                           const uint32_t inInstanceID )
{
    LBASSERT( object );
    LB_TS_THREAD( _receiverThread );

    uint32_t instanceID = inInstanceID;
    if( inInstanceID == CO_INSTANCE_INVALID )
        instanceID = _genNextID( _instanceIDs );

    object->attach( id, instanceID );

    {
        lunchbox::ScopedFastWrite mutex( _objects );
        Objects& objects = _objects.data[ id ];
        LBASSERTINFO( !object->isMaster() || objects.empty(),
                      "Attaching master " << *object << ", " <<
                      objects.size() << " attached objects with same ID, " <<
                      "first is " << ( objects[0]->isMaster() ? "master " :
                                       "slave " ) << *objects[0] );
        objects.push_back( object );
    }

    _localNode->flushCommands(); // redispatch pending commands

    LBLOG( LOG_OBJECTS ) << "attached " << *object << " @"
                         << static_cast< void* >( object ) << std::endl;
}
开发者ID:tribal-tec,项目名称:Collage,代码行数:28,代码来源:objectStore.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LBI函数代码示例发布时间:2022-05-30
下一篇:
C++ LBASSERT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap