本文整理汇总了C++中LBASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ LBASSERT函数的具体用法?C++ LBASSERT怎么用?C++ LBASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LBASSERT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: LBASSERT
void EventHandler::_dispatch()
{
Display* display = _window->getXDisplay();
LBASSERT( display );
if( !display )
return;
while( XPending( display ))
{
WindowEvent event;
XEvent& xEvent = event.xEvent;
XNextEvent( display, &xEvent );
event.time = _window->getConfig()->getTime();
for( EventHandlers::const_iterator i = _eventHandlers->begin();
i != _eventHandlers->end(); ++i )
{
EventHandler* handler = *i;
handler->_processEvent( event );
}
}
}
开发者ID:maxmah,项目名称:Equalizer,代码行数:23,代码来源:eventHandler.cpp
示例2: glLightModeli
bool Window::configInitGL( const eq::uint128_t& initID )
{
if( !eq::Window::configInitGL( initID ))
return false;
glLightModeli( GL_LIGHT_MODEL_LOCAL_VIEWER, 1 );
glEnable( GL_CULL_FACE ); // OPT - produces sparser images in DB mode
glCullFace( GL_BACK );
LBASSERT( !_state );
_state = new VertexBufferState( getObjectManager( ));
const Config* config = static_cast< const Config* >( getConfig( ));
const InitData& initData = config->getInitData();
if( initData.showLogo( ))
_loadLogo();
if( initData.useGLSL() )
_loadShaders();
return true;
}
开发者ID:BillTheBest,项目名称:Equalizer,代码行数:23,代码来源:window.cpp
示例3: GPUAsyncLoader
GPUCacheManager::GPUCacheManager( constGPUCacheIndexSPtr cacheIndex, RAMPoolSPtr ramPool, const byte bytesNum,
Window* wnd )
:_iteration( 1 )
,_cacheIndex( cacheIndex )
,_gpuLoader( new GPUAsyncLoader( wnd ))
,_nodeIdBeingLoaded( 0 )
,_cachePosBeingLoaded( 0 )
{
LBASSERT( _cacheIndex );
_gpuLoader->start();
const GPULoadRespond respond = _gpuLoader->readLoadRespond();
if( respond.status.value != GPULoadStatus::INITIALIZED )
LBERROR << "Incorrect respond from GPU Async Loader" << std::endl;
_gpuLoader->postCommand( GPUCommand::PAUSE );
_gpuLoader->initialize( ramPool, cacheIndex, bytesNum );
_resize();
LBWARN << " new GPUCacheManager, updating GPU Cache" << std::endl;
_gpuLoader->postCommand( GPUCommand::UPDATE );
_gpuLoader->postCommand( GPUCommand::RESUME );
}
开发者ID:rballester,项目名称:Livre,代码行数:23,代码来源:gpuCacheManager.cpp
示例4: LBASSERT
uint128_t FullMasterCM::commit( const uint32_t incarnation )
{
LBASSERT( _version != VERSION_NONE );
if( !_object->isDirty( ))
{
Mutex mutex( _slaves );
_updateCommitCount( incarnation );
_obsolete();
return _version;
}
_maxVersion.waitGE( _version.low() + 1 );
Mutex mutex( _slaves );
#if 0
LBLOG( LOG_OBJECTS ) << "commit v" << _version << " " << command
<< std::endl;
#endif
_updateCommitCount( incarnation );
_commit();
_obsolete();
return _version;
}
开发者ID:rballester,项目名称:Collage,代码行数:23,代码来源:fullMasterCM.cpp
示例5: while
//===========================================================================
// ICommand handling methods
//===========================================================================
void Server::handleCommands()
{
_running = true;
while( _running ) // set to false in _cmdShutdown()
{
const co::ICommands& commands = _mainThreadQueue.popAll();
LBASSERT( !commands.empty( ));
for( co::ICommandsCIter i = commands.begin(); i != commands.end(); ++i )
{
// We want to avoid a non-const copy of commands, hence the cast...
co::ICommand& command = const_cast< co::ICommand& >( *i );
if( !command( ))
{
LBABORT( "Error handling " << command );
}
if( !_running )
break;
}
}
_mainThreadQueue.flush();
}
开发者ID:swq0553,项目名称:Equalizer,代码行数:26,代码来源:server.cpp
示例6: getPipe
bool Window::configInitSystemWindow( const uint128_t& )
{
const Pipe* pipe = getPipe();
WindowSettings settings = getSettings();
const SystemWindow* sysWindow = _sharedContextWindow ?
_sharedContextWindow->getSystemWindow() : 0;
settings.setSharedContextWindow( sysWindow );
SystemWindow* systemWindow =
pipe->getWindowSystem().createWindow( this, settings );
LBASSERT( systemWindow );
if( !systemWindow->configInit( ))
{
LBWARN << "System window initialization failed" << std::endl;
systemWindow->configExit();
delete systemWindow;
return false;
}
setPixelViewport( systemWindow->getPixelViewport( ));
setSystemWindow( systemWindow );
return true;
}
开发者ID:Angels-group,项目名称:Equalizer,代码行数:23,代码来源:window.cpp
示例7: LBASSERT
bool GLSLShaders::loadShaders(const std::string &vShader,
const std::string &fShader,
const GLEWContext *glewContext)
{
if (_shadersLoaded)
return true;
LBASSERT(glewContext);
_glewContext = glewContext;
_program = glCreateProgramObjectARB();
GLhandleARB vertexShader = _loadShader(vShader, GL_VERTEX_SHADER_ARB);
if (!vertexShader)
return _cleanupOnError();
glAttachObjectARB(_program, vertexShader);
GLhandleARB fragmentShader = _loadShader(fShader, GL_FRAGMENT_SHADER_ARB);
if (!fragmentShader)
return _cleanupOnError(vertexShader);
glAttachObjectARB(_program, fragmentShader);
glLinkProgramARB(_program);
GLint status;
glGetObjectParameterivARB(_program, GL_OBJECT_LINK_STATUS_ARB, &status);
if (status != GL_FALSE)
{
_shadersLoaded = true;
return true;
}
_printLog(_program, "Linking");
return _cleanupOnError(vertexShader, fragmentShader);
}
开发者ID:Eyescale,项目名称:Equalizer,代码行数:37,代码来源:glslShaders.cpp
示例8: setup
bool setup( lunchbox::PluginRegistry& from, const uint32_t name,
const GLEWContext* gl )
{
if( name == info.name )
{
LBASSERT( isGood() && instance );
return true;
}
clear();
if( name <= EQ_COMPRESSOR_NONE )
{
LBASSERT( isGood() && instance );
return true;
}
plugin = from.findPlugin( name );
LBASSERT( plugin );
if( !plugin )
{
LBWARN << "Plugin for downloader 0x" << std::hex << name << std::dec
<< " not found" << std::endl;
return false;
}
if( !gl )
LBWARN << "Can't verify plugin compatibility, no GLEWContext given"
<< std::endl;
else if( !plugin->isCompatible( name, gl ))
{
LBWARN << "Plugin for downloader 0x" << std::hex << name << std::dec
<< " not compatible with OpenGL implementation" << std::endl;
return false;
}
instance = plugin->newDecompressor( name );
info = plugin->findInfo( name );
LBASSERT( isGood( ));
LBASSERT( instance );
LBASSERT( info.name == name );
LBLOG( LOG_PLUGIN ) << "Instantiated downloader " << info << std::endl;
return instance;
}
开发者ID:chenxinghua,项目名称:Lunchbox,代码行数:44,代码来源:downloader.cpp
示例9: setName
bool Client::initLocal( const int argc, char** argv )
{
bool isClient = false;
std::string clientOpts;
if( _impl->name.empty() && argc > 0 && argv )
{
const boost::filesystem::path prog = argv[0];
setName( prog.stem().string( ));
}
for( int i=1; i<argc; ++i )
{
if( std::string( "--eq-client" ) == argv[i] )
{
isClient = true;
if( i < argc-1 && argv[i+1][0] != '-' ) // server-started client
{
clientOpts = argv[++i];
if( !deserialize( clientOpts ))
LBWARN << "Failed to parse client listen port parameters"
<< std::endl;
LBASSERT( !clientOpts.empty( ));
}
}
else if( _isParameterOption( "--eq-layout", argc, argv, i ))
_impl->activeLayouts.push_back( argv[++i] );
else if( _isParameterOption( "--eq-gpufilter" , argc, argv, i ))
_impl->gpuFilter = argv[ ++i ];
else if( _isParameterOption( "--eq-modelunit", argc, argv, i ))
{
std::istringstream unitString( argv[++i] );
unitString >> _impl->modelUnit;
}
}
开发者ID:RubenGarcia,项目名称:Equalizer,代码行数:36,代码来源:client.cpp
示例10: LBASSERT
bool MasterConfig::init()
{
LBASSERT( !_objects );
_objects = new ObjectMap( *this, *getApplication( ));
co::Object* initData = getInitData();
if( initData )
LBCHECK( _objects->register_( initData, OBJECTTYPE_INITDATA ));
_objects->setInitData( initData );
LBCHECK( registerObject( _objects ));
if( !eq::Config::init( _objects->getID( )))
{
LBWARN << "Error during initialization: " << getError() << std::endl;
exit();
return false;
}
if( getError( ))
LBWARN << "Error during initialization: " << getError() << std::endl;
_redraw = true;
return true;
}
开发者ID:qhliao,项目名称:Equalizer,代码行数:24,代码来源:masterConfig.cpp
示例11: LBASSERT
void DataIStream::_read( void* data, uint64_t size )
{
if( !_checkBuffer( ))
{
LBUNREACHABLE;
LBERROR << "No more input data" << std::endl;
return;
}
LBASSERT( _impl->input );
if( size > _impl->inputSize - _impl->position )
{
LBERROR << "Not enough data in input buffer: need " << size
<< " bytes, " << _impl->inputSize - _impl->position << " left "
<< std::endl;
LBUNREACHABLE;
// TODO: Allow reads which are asymmetric to writes by reading from
// multiple blocks here?
return;
}
memcpy( data, _impl->input + _impl->position, size );
_impl->position += size;
}
开发者ID:OlafRocket,项目名称:Collage,代码行数:24,代码来源:dataIStream.cpp
示例12: GetModuleHandle
bool DSO::open( const std::string& fileName )
{
if( _impl->dso )
{
LBWARN << "DSO already open, close it first" << std::endl;
return false;
}
if( fileName.empty( ))
{
#ifdef _WIN32 //_MSC_VER
_impl->dso = GetModuleHandle( 0 );
LBASSERT( _impl->dso );
#else
_impl->dso = RTLD_DEFAULT;
#endif
}
else
{
#ifdef _WIN32 //_MSC_VER
_impl->dso = LoadLibrary( fileName.c_str() );
#elif defined( RTLD_LOCAL )
_impl->dso = dlopen( fileName.c_str(), RTLD_LAZY | RTLD_LOCAL );
#else
_impl->dso = dlopen( fileName.c_str(), RTLD_LAZY );
#endif
if( !_impl->dso )
{
LBINFO << "Can't open library " << fileName << ": " << LB_DL_ERROR
<< std::endl;
return false;
}
}
return true;
}
开发者ID:biddisco,项目名称:Lunchbox,代码行数:36,代码来源:dso.cpp
示例13: LBASSERT
bool Connection::send( const Connections& connections, Packet& packet,
const void* const* items, const uint64_t* sizes,
const size_t nItems )
{
if( connections.empty( ))
return true;
packet.size -= 8;
const uint64_t headerSize = packet.size;
for( size_t i = 0; i < nItems; ++i )
{
LBASSERT( sizes[i] > 0 );
packet.size += sizes[ i ] + sizeof( uint64_t );
}
bool success = true;
for( Connections::const_iterator i = connections.begin();
i < connections.end(); ++i )
{
ConnectionPtr connection = *i;
connection->lockSend();
if( !connection->send( &packet, headerSize, true ))
success = false;
for( size_t j = 0; j < nItems; ++j )
if( !connection->send( &sizes[j], sizeof(uint64_t), true ) ||
!connection->send( items[j], sizes[j], true ))
{
success = false;
}
connection->unlockSend();
}
return success;
}
开发者ID:aoighost,项目名称:Equalizer,代码行数:36,代码来源:connection.cpp
示例14: setup
bool setup(const uint32_t name)
{
if (plugin && info.name == name)
return true;
clear();
if (name <= EQ_COMPRESSOR_NONE)
return true;
plugin = pression::PluginRegistry::getInstance().findPlugin(name);
LBASSERTINFO(plugin, "Can't find plugin for decompressor " << name);
if (!plugin)
return false;
instance = plugin->newDecompressor(name);
info = plugin->findInfo(name);
LBASSERT(info.name == name);
LBLOG(LOG_PLUGIN) << "Instantiated " << (instance ? "" : "empty ")
<< "decompressor of type 0x" << std::hex << name
<< std::dec << std::endl;
return true;
}
开发者ID:Eyescale,项目名称:Pression,代码行数:24,代码来源:decompressor.cpp
示例15: getCanvases
void Config::_switchCanvas()
{
const eq::Canvases& canvases = getCanvases();
if( canvases.empty( ))
return;
_frameData.setCurrentViewID( eq::UUID( ));
if( !_currentCanvas )
{
_currentCanvas = canvases.front();
return;
}
eq::CanvasesCIter i = stde::find( canvases, _currentCanvas );
LBASSERT( i != canvases.end( ));
++i;
if( i == canvases.end( ))
_currentCanvas = canvases.front();
else
_currentCanvas = *i;
_switchView(); // activate first view on canvas
}
开发者ID:steiner-,项目名称:Equalizer,代码行数:24,代码来源:config.cpp
示例16: LBASSERT
//---------------------------------------------------------------------------
// exit
//---------------------------------------------------------------------------
bool Config::exit()
{
if( _state != STATE_RUNNING )
LBWARN << "Exiting non-initialized config" << std::endl;
LBASSERT( _state == STATE_RUNNING || _state == STATE_INITIALIZING );
_state = STATE_EXITING;
const Canvases& canvases = getCanvases();
for( Canvases::const_iterator i = canvases.begin();
i != canvases.end(); ++i )
{
Canvas* canvas = *i;
canvas->exit();
}
for( Compounds::const_iterator i = _compounds.begin();
i != _compounds.end(); ++i )
{
Compound* compound = *i;
compound->exit();
}
const bool success = _updateRunning( true );
// TODO: is this needed? sender of CMD_CONFIG_EXIT is the appNode itself
// which sets the running state to false anyway. Besides, this event is
// not handled by the appNode because it is already in exiting procedure
// and does not call handleEvents anymore
// eile: May be needed for reliability?
send( findApplicationNetNode(), fabric::CMD_CONFIG_EVENT ) << Event::EXIT;
_needsFinish = false;
_state = STATE_STOPPED;
return success;
}
开发者ID:weetgo,项目名称:Equalizer,代码行数:39,代码来源:config.cpp
示例17: LBASSERT
bool Window::createTransferWindow()
{
LBASSERT( _systemWindow );
if( _transferWindow )
return true;
// create another (shared) osWindow with no drawable
WindowSettings settings = getSettings();
settings.setIAttribute( WindowSettings::IATTR_HINT_DRAWABLE, OFF );
const SystemWindow* sysWindow = _sharedContextWindow ?
_sharedContextWindow->getSystemWindow() : 0;
settings.setSharedContextWindow( sysWindow );
const Pipe* pipe = getPipe();
_transferWindow = pipe->getWindowSystem().createWindow( this, settings );
if( _transferWindow )
{
if( !_transferWindow->configInit( ))
{
LBWARN << "Transfer window initialization failed" << std::endl;
delete _transferWindow;
_transferWindow = 0;
}
else
makeCurrentTransfer(); // #177
}
else
LBERROR << "Window system " << pipe->getWindowSystem()
<< " not implemented or supported" << std::endl;
makeCurrent();
LBVERB << "Transfer window initialization finished" << std::endl;
return _transferWindow != 0;
}
开发者ID:gitter-badger,项目名称:Equalizer,代码行数:36,代码来源:window.cpp
示例18: LB_TS_THREAD
void StaticSlaveCM::addInstanceDatas( const ObjectDataIStreamDeque& cache,
const uint128_t& /* start */ )
{
LB_TS_THREAD( _rcvThread );
LBASSERT( _currentIStream );
LBASSERT( _currentIStream->getDataSize() == 0 );
LBASSERT( cache.size() == 1 );
if( cache.empty( ))
return;
ObjectDataIStream* stream = cache.front();
LBASSERT( stream );
LBASSERT( stream->isReady( ));
LBASSERT( stream->getVersion() == VERSION_FIRST );
if( !stream->isReady() || stream->getVersion() != VERSION_FIRST )
return;
LBLOG( LOG_OBJECTS ) << "Adding cached instance data" << std::endl;
delete _currentIStream;
_currentIStream = new ObjectDataIStream( *stream );
}
开发者ID:aoighost,项目名称:Equalizer,代码行数:22,代码来源:staticSlaveCM.cpp
示例19: LBASSERT
PixelViewport ROIFinder::_getObjectPVP( const PixelViewport& pvp,
const uint8_t* src )
{
LBASSERT( pvp.x >= 0 && pvp.x+pvp.w <= _wb &&
pvp.y >= 0 && pvp.y+pvp.h <= _hb );
// Calculate per-pixel histograms
const uint8_t* s = src + pvp.y*_wb + pvp.x;
memset( _histX, 0, pvp.w );
memset( _histY, 0, pvp.h );
for( int32_t y = 0; y < pvp.h; y++ )
{
for( int32_t x = 0; x < pvp.w; x++ )
{
const uint8_t val = s[ x ] & 1;
_histX[ x ] += val;
_histY[ y ] += val;
}
s += _wb;
}
// Find AABB based on X and Y axis historgams
int32_t xMin = pvp.w;
for( int32_t x = 0; x < pvp.w; x++ )
if( _histX[x] != 0 )
{
xMin = x;
break;
}
int32_t xMax = 0;
for( int32_t x = pvp.w-1; x >= 0; x-- )
if( _histX[x] != 0 )
{
xMax = x;
break;
}
if( xMax < xMin )
return PixelViewport( pvp.x, pvp.y, 0, 0 );
int32_t yMin = pvp.h;
for( int32_t y = 0; y < pvp.h; y++ )
if( _histY[y] != 0 )
{
yMin = y;
break;
}
int32_t yMax = 0;
for( int32_t y = pvp.h-1; y >= 0; y-- )
if( _histY[y] != 0 )
{
yMax = y;
break;
}
if( yMax < yMin )
return PixelViewport( pvp.x, pvp.y, 0, 0 );
return PixelViewport( pvp.x+xMin, pvp.y+yMin, xMax-xMin+1, yMax-yMin+1 );
}
开发者ID:BillTheBest,项目名称:Equalizer,代码行数:63,代码来源:roiFinder.cpp
示例20: LBASSERT
bool ConnectionSet::_setupFDSet()
{
// if( !_impl->dirty )
// {
//#ifndef _WIN32
// // TODO: verify that poll() really modifies _fdSet, and remove the copy
// // if it doesn't. The man page seems to hint that poll changes fds.
// _impl->fdSet = _impl->fdSetCopy;
//#endif
// return true;
// }
_impl->dirty = false;
_impl->fdSet.setSize( 0 );
_impl->fdSetResult.setSize( 0 );
#ifdef _WIN32
// add self connection
HANDLE readHandle = _impl->selfConnection->getNotifier();
LBASSERT( readHandle );
_impl->fdSet.append( readHandle );
Result res;
res.connection = _impl->selfConnection.get();
_impl->fdSetResult.append( res );
// add regular connections
_impl->lock.set();
for( ConnectionsCIter i = _impl->connections.begin();
i != _impl->connections.end(); ++i )
{
ConnectionPtr connection = *i;
if ( connection->isRead() )
continue;
readHandle = connection->getNotifier();
if( !readHandle )
{
LBINFO << "Cannot select connection " << connection
<< ", connection does not provide a read handle" << std::endl;
_impl->connection = connection;
_impl->lock.unset();
return false;
}
_impl->fdSet.append( readHandle );
Result result;
result.connection = connection.get();
_impl->fdSetResult.append( result );
}
for( ThreadsCIter i=_impl->threads.begin(); i != _impl->threads.end(); ++i )
{
Thread* thread = *i;
readHandle = thread->notifier;
LBASSERT( readHandle );
_impl->fdSet.append( readHandle );
Result result;
result.thread = thread;
_impl->fdSetResult.append( result );
}
_impl->lock.unset();
#else // _WIN32
pollfd fd;
fd.events = POLLIN; // | POLLPRI;
// add self 'connection'
fd.fd = _impl->selfConnection->getNotifier();
LBASSERT( fd.fd > 0 );
fd.revents = 0;
_impl->fdSet.append( fd );
Result result;
result.connection = _impl->selfConnection.get();
_impl->fdSetResult.append( result );
// add regular connections
_impl->lock.set();
for( ConnectionsCIter i = _impl->allConnections.begin();
i != _impl->allConnections.end(); ++i )
{
ConnectionPtr connection = *i;
if ( connection->isRead() )
continue;
fd.fd = connection->getNotifier();
if( fd.fd <= 0 )
{
LBINFO << "Cannot select connection " << connection
<< ", connection " << typeid( *connection.get( )).name()
<< " doesn't have a file descriptor" << std::endl;
_impl->connection = connection;
_impl->lock.unset();
return false;
}
//.........这里部分代码省略.........
开发者ID:rttag,项目名称:Collage,代码行数:101,代码来源:connectionSet.cpp
注:本文中的LBASSERT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论