本文整理汇总了C++中LBLOG函数的典型用法代码示例。如果您正苦于以下问题:C++ LBLOG函数的具体用法?C++ LBLOG怎么用?C++ LBLOG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LBLOG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LBLOG
uint128_t UnbufferedMasterCM::commit( const uint32_t incarnation )
{
#if 0
LBLOG( LOG_OBJECTS ) << "commit v" << _version << " " << command
<< std::endl;
#endif
if( !_object->isDirty( ))
return _version;
_maxVersion.waitGE( _version.low() + 1 );
Mutex mutex( _slaves );
if( _slaves->empty( ))
return _version;
ObjectDeltaDataOStream os( this );
os.enableCommit( _version + 1, *_slaves );
_object->pack( os );
os.disable();
if( os.hasSentData( ))
{
++_version;
LBASSERT( _version != VERSION_NONE );
#if 0
LBLOG( LOG_OBJECTS ) << "Committed v" << _version << ", id "
<< _object->getID() << std::endl;
#endif
}
return _version;
}
示例2: LBLOG
bool Window::_cmdConfigInit( co::Command& command )
{
const WindowConfigInitPacket* packet =
command.get<WindowConfigInitPacket>();
LBLOG( LOG_INIT ) << "TASK window config init " << packet << std::endl;
WindowConfigInitReplyPacket reply;
setError( ERROR_NONE );
if( getPipe()->isRunning( ))
{
_state = STATE_INITIALIZING;
reply.result = configInit( packet->initID );
if( reply.result )
_state = STATE_RUNNING;
}
else
{
setError( ERROR_WINDOW_PIPE_NOTRUNNING );
reply.result = false;
}
LBLOG( LOG_INIT ) << "TASK window config init reply " << &reply <<std::endl;
commit();
send( command.getNode(), reply );
return true;
}
示例3: command
bool Window::_cmdConfigInit( co::Command& cmd )
{
co::ObjectCommand command( cmd );
LBLOG( LOG_INIT ) << "TASK window config init " << command << std::endl;
setError( ERROR_NONE );
bool result = false;
if( getPipe()->isRunning( ))
{
_state = STATE_INITIALIZING;
result = configInit( command.get< uint128_t >( ));
if( result )
_state = STATE_RUNNING;
}
else
setError( ERROR_WINDOW_PIPE_NOTRUNNING );
LBLOG( LOG_INIT ) << "TASK window config init reply " << std::endl;
commit();
send( command.getNode(), fabric::CMD_WINDOW_CONFIG_INIT_REPLY ) << result;
return true;
}
示例4: getNodes
void Config::_stopNodes()
{
// wait for the nodes to stop, destroy entities, disconnect
Nodes stoppingNodes;
const Nodes& nodes = getNodes();
for( Nodes::const_iterator i = nodes.begin(); i != nodes.end(); ++i )
{
Node* node = *i;
const State state = node->getState();
if( state != STATE_STOPPED && state != STATE_FAILED )
continue;
LBASSERT( !node->isActive() || state == STATE_FAILED );
if( node->isApplicationNode( ))
continue;
co::NodePtr netNode = node->getNode();
if( !netNode ) // already disconnected
continue;
LBLOG( LOG_INIT ) << "Exiting node" << std::endl;
if( state == STATE_FAILED )
node->setState( STATE_STOPPED );
stoppingNodes.push_back( node );
LBASSERT( netNode.isValid( ));
netNode->send( fabric::CMD_SERVER_DESTROY_CONFIG )
<< getID() << LB_UNDEFINED_UINT32;
netNode->send( fabric::CMD_CLIENT_EXIT );
}
// now wait that the render clients disconnect
uint32_t nSleeps = 50; // max 5 seconds for all clients
for( Nodes::const_iterator i = stoppingNodes.begin();
i != stoppingNodes.end(); ++i )
{
Node* node = *i;
co::NodePtr netNode = node->getNode();
node->setNode( 0 );
if( nSleeps )
while( netNode->isConnected() && --nSleeps )
lunchbox::sleep( 100 ); // ms
if( netNode->isConnected( ))
{
co::LocalNodePtr localNode = getLocalNode();
LBASSERT( localNode.isValid( ));
LBWARN << "Forcefully disconnecting exited render client node"
<< std::endl;
localNode->disconnect( netNode );
}
LBLOG( LOG_INIT ) << "Disconnected node" << std::endl;
}
}
示例5: LBASSERT
//===========================================================================
// Operations
//===========================================================================
//---------------------------------------------------------------------------
// init
//---------------------------------------------------------------------------
void Window::configInit( const uint128_t& initID, const uint32_t /*frame*/ )
{
LBASSERT( !needsDelete( ));
LBASSERT( _state == STATE_STOPPED );
_state = STATE_INITIALIZING;
LBLOG( LOG_INIT ) << "Create Window" << std::endl;
getPipe()->send( fabric::CMD_PIPE_CREATE_WINDOW ) << getID();
LBLOG( LOG_INIT ) << "Init Window" << std::endl;
send( fabric::CMD_WINDOW_CONFIG_INIT ) << initID;
LBLOG( LOG_TASKS ) << "TASK window configInit " << " id " << getID()
<< std::endl;
}
示例6: getMode
void View::trigger( const Canvas* canvas, const bool active )
{
const Mode mode = getMode();
Config* config = getConfig();
// (De)activate destination compounds for canvas/eye(s)
for( Channels::const_iterator i = _channels.begin();
i != _channels.end(); ++i )
{
Channel* channel = *i;
const Canvas* channelCanvas = channel->getCanvas();
const Layout* canvasLayout = channelCanvas->getActiveLayout();
if(( canvas && channelCanvas != canvas ) ||
( !canvas && canvasLayout != getLayout( )))
{
continue;
}
const Segment* segment = channel->getSegment();
const uint32_t segmentEyes = segment->getEyes();
const uint32_t eyes = ( mode == MODE_MONO ) ?
EYE_CYCLOP & segmentEyes : EYES_STEREO & segmentEyes;
if( eyes == 0 )
continue;
ConfigDestCompoundVisitor visitor( channel, true /*activeOnly*/ );
config->accept( visitor );
const Compounds& compounds = visitor.getResult();
for( Compounds::const_iterator j = compounds.begin();
j != compounds.end(); ++j )
{
Compound* compound = *j;
if( active )
{
compound->activate( eyes );
LBLOG( LOG_VIEW ) << "Activate " << compound->getName()
<< std::endl;
}
else
{
compound->deactivate( eyes );
LBLOG( LOG_VIEW ) << "Deactivate " << compound->getName()
<< std::endl;
}
}
}
}
示例7: LB_TS_THREAD
bool Pipe::_cmdConfigInit( co::ICommand& cmd )
{
LB_TS_THREAD( _pipeThread );
co::ObjectICommand command( cmd );
const uint128_t initID = command.get< uint128_t >();
const uint32_t frameNumber = command.get< uint32_t >();
LBLOG( LOG_INIT ) << "Init pipe " << command << " init id " << initID
<< " frame " << frameNumber << std::endl;
if( !isThreaded( ))
{
_impl->windowSystem = selectWindowSystem();
_setupCommandQueue();
}
setError( ERROR_NONE );
Node* node = getNode();
LBASSERT( node );
node->waitInitialized();
bool result = false;
if( node->isRunning( ))
{
_impl->currentFrame = frameNumber;
_impl->finishedFrame = frameNumber;
_impl->unlockedFrame = frameNumber;
_impl->state = STATE_INITIALIZING;
result = configInit( initID );
if( result )
_impl->state = STATE_RUNNING;
}
else
setError( ERROR_PIPE_NODE_NOTRUNNING );
LBLOG( LOG_INIT ) << "TASK pipe config init reply result " << result
<< std::endl;
co::NodePtr netNode = command.getNode();
commit();
send( netNode, fabric::CMD_PIPE_CONFIG_INIT_REPLY ) << result;
return true;
}
示例8: LBASSERT
void ObjectStore::_detach( Object* object )
{
// check also _cmdUnmapObject when modifying!
LBASSERT( object );
LB_TS_THREAD( _receiverThread );
if( !object->isAttached() )
return;
const uint128_t& id = object->getID();
LBASSERT( _objects->find( id ) != _objects->end( ));
LBLOG( LOG_OBJECTS ) << "Detach " << *object << std::endl;
Objects& objects = _objects.data[ id ];
Objects::iterator i = find( objects.begin(),objects.end(), object );
LBASSERT( i != objects.end( ));
{
lunchbox::ScopedFastWrite mutex( _objects );
objects.erase( i );
if( objects.empty( ))
_objects->erase( id );
}
LBASSERT( object->getInstanceID() != CO_INSTANCE_INVALID );
object->detach();
return;
}
示例9: 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;
}
示例10: LB_TS_THREAD
//---------------------------------------------------------------------------
// command handlers
//---------------------------------------------------------------------------
bool VersionedSlaveCM::_cmdData( Command& command )
{
LB_TS_THREAD( _rcvThread );
LBASSERT( command.getNode().isValid( ));
if( !_currentIStream )
_currentIStream = _iStreamCache.alloc();
_currentIStream->addDataPacket( command );
if( _currentIStream->isReady( ))
{
const uint128_t& version = _currentIStream->getVersion();
#if 0
LBLOG( LOG_OBJECTS ) << "v" << version << ", id " << _object->getID()
<< "." << _object->getInstanceID() << " ready"
<< std::endl;
#endif
#ifndef NDEBUG
ObjectDataIStream* debugStream = 0;
_queuedVersions.getBack( debugStream );
if ( debugStream )
{
LBASSERT( debugStream->getVersion() + 1 == version );
}
#endif
_queuedVersions.push( _currentIStream );
_object->notifyNewHeadVersion( version );
_currentIStream = 0;
}
return true;
}
示例11: 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 );
}
示例12: LBSAFECAST
bool ObjectStore::_finishSync( const uint32_t requestID, Object* object )
{
if( requestID == LB_UNDEFINED_UINT32 )
return false;
void* data = _localNode->getRequestData( requestID );
if( data == 0 )
return false;
ObjectDataIStream* is = LBSAFECAST( ObjectDataIStream*, data );
bool ok = false;
_localNode->waitRequest( requestID, ok );
if( !ok )
{
LBWARN << "Object synchronization failed" << std::endl;
delete is;
return false;
}
is->waitReady();
object->applyInstanceData( *is );
LBLOG( LOG_OBJECTS ) << "Synced " << lunchbox::className( object )
<< std::endl;
delete is;
return true;
}
示例13: command
bool Window::_cmdFrameStart( co::ICommand& cmd )
{
co::ObjectICommand command( cmd );
LB_TS_THREAD( _pipeThread );
const uint128_t& version = command.read< uint128_t >();
const uint128_t& frameID = command.read< uint128_t >();
const uint32_t frameNumber = command.read< uint32_t >();
LBLOG( LOG_TASKS ) << "TASK frame start " << getName()
<< " " << command << " frame " << frameNumber
<< " id " << frameID << std::endl;
//_grabFrame( frameNumber ); single-threaded
sync( version );
const DrawableConfig& drawableConfig = getDrawableConfig();
if( drawableConfig.doublebuffered )
_renderContexts[FRONT].swap( _renderContexts[BACK] );
_renderContexts[BACK].clear();
makeCurrent();
frameStart( frameID, frameNumber );
return true;
}
示例14: 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;
}
示例15: LB_TS_THREAD
bool Node::_cmdConfigInit( co::Command& command )
{
LB_TS_THREAD( _nodeThread );
const NodeConfigInitPacket* packet =
command.get<NodeConfigInitPacket>();
LBLOG( LOG_INIT ) << "Init node " << packet << std::endl;
_state = STATE_INITIALIZING;
_currentFrame = packet->frameNumber;
_unlockedFrame = packet->frameNumber;
_finishedFrame = packet->frameNumber;
_setAffinity();
transmitter.start();
setError( ERROR_NONE );
NodeConfigInitReplyPacket reply;
reply.result = configInit( packet->initID );
if( getIAttribute( IATTR_THREAD_MODEL ) == eq::UNDEFINED )
setIAttribute( IATTR_THREAD_MODEL, eq::DRAW_SYNC );
_state = reply.result ? STATE_RUNNING : STATE_INIT_FAILED;
commit();
send( command.getNode(), reply );
return true;
}