本文整理汇总了C++中BROADCAST函数的典型用法代码示例。如果您正苦于以下问题:C++ BROADCAST函数的具体用法?C++ BROADCAST怎么用?C++ BROADCAST使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BROADCAST函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isc_rwlock_unlock
isc_result_t
isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
REQUIRE(VALID_RWLOCK(rwl));
LOCK(&rwl->lock);
REQUIRE(rwl->type == type);
UNUSED(type);
#ifdef ISC_RWLOCK_TRACE
print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
ISC_MSG_PREUNLOCK, "preunlock"), rwl, type);
#endif
INSIST(rwl->active > 0);
rwl->active--;
if (rwl->active == 0) {
if (rwl->original != isc_rwlocktype_none) {
rwl->type = rwl->original;
rwl->original = isc_rwlocktype_none;
}
if (rwl->type == isc_rwlocktype_read) {
rwl->granted = 0;
if (rwl->writers_waiting > 0) {
rwl->type = isc_rwlocktype_write;
SIGNAL(&rwl->writeable);
} else if (rwl->readers_waiting > 0) {
/* Does this case ever happen? */
BROADCAST(&rwl->readable);
}
} else {
if (rwl->readers_waiting > 0) {
if (rwl->writers_waiting > 0 &&
rwl->granted < rwl->write_quota) {
SIGNAL(&rwl->writeable);
} else {
rwl->granted = 0;
rwl->type = isc_rwlocktype_read;
BROADCAST(&rwl->readable);
}
} else if (rwl->writers_waiting > 0) {
rwl->granted = 0;
SIGNAL(&rwl->writeable);
} else {
rwl->granted = 0;
}
}
}
INSIST(rwl->original == isc_rwlocktype_none);
#ifdef ISC_RWLOCK_TRACE
print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
ISC_MSG_POSTUNLOCK, "postunlock"),
rwl, type);
#endif
UNLOCK(&rwl->lock);
return (ISC_R_SUCCESS);
}
示例2: BROADCAST
void PointerNode::manipulate (int b)
{
// Immediately when the user presses the manipulate button, we check to see
// if we are pointing at a new node. ie, we make sure the user is NOT
// pointing at a dragger anymore, and
if (b && spinApp::Instance().getContext()->isServer())
{
if (1) //!getDraggerFromIntersections())
{
GroupNode *lastNode = dynamic_cast<GroupNode*>(lastManipulated->s_thing);
GroupNode *newNode = dynamic_cast<GroupNode*>(getNodeFromIntersections(0));
if (newNode && (newNode!=lastNode))
{
dragger_ = NULL;
if (lastNode) lastNode->setManipulator("NULL");
newNode->setManipulator(lastManipulatorType_.c_str());
lastManipulated = newNode->getNodeSymbol();
}
}
}
// then we just set the 'doManipulation' flag, which will
doManipulation = (bool) b;
BROADCAST(this, "si", "manipulate", this->getManipulate());
}
示例3: BROADCAST
void DSPNode::setRadius (float newvalue)
{
_radius = newvalue;
if (_radius < 0) _radius = 0;
if (_radius > 0) this->setLength(_radius/AS_DEBUG_SCALE);
BROADCAST(this, "sf", "setRadius", getRadius());
}
示例4: if
void PointerNode::setManipulator(const char *manipulatorType)
{
if (spinApp::Instance().getContext()->isServer())
{
GroupNode *lastNode = dynamic_cast<GroupNode*>(lastManipulated->s_thing);
// see if there is an intersection with a GroupNode, and if so, tell
// that node to enable the manipulator
GroupNode *n = dynamic_cast<GroupNode*>(getNodeFromIntersections(0));
if (n)
{
// if we're targetting a new node, make sure that the last
// manipulated node's dragger gets turned off:
if ((lastNode) && (n != lastNode))
lastNode->setManipulator("NULL");
n->setManipulator(manipulatorType);
lastManipulated = n->getNodeSymbol();
}
// if there was no intersection, load the manipulator on the last object
// that was manipulated
else if (lastNode)
{
lastNode->setManipulator(manipulatorType);
}
lastManipulatorType_ = std::string(manipulatorType);
}
else
{
BROADCAST(this, "ss", "setManipulator", manipulatorType);
}
}
示例5: task_finished
static void
task_finished(isc_task_t *task) {
isc_taskmgr_t *manager = task->manager;
REQUIRE(EMPTY(task->events));
REQUIRE(EMPTY(task->on_shutdown));
REQUIRE(task->references == 0);
REQUIRE(task->state == task_state_done);
XTRACE("task_finished");
LOCK(&manager->lock);
UNLINK(manager->tasks, task, link);
#ifdef ISC_PLATFORM_USETHREADS
if (FINISHED(manager)) {
/*
* All tasks have completed and the
* task manager is exiting. Wake up
* any idle worker threads so they
* can exit.
*/
BROADCAST(&manager->work_available);
}
#endif /* ISC_PLATFORM_USETHREADS */
UNLOCK(&manager->lock);
DESTROYLOCK(&task->lock);
task->magic = 0;
isc_mem_put(manager->mctx, task, sizeof(*task));
}
示例6: drawDirectivity
void DSPNode::setRolloff (const char *newvalue)
{
// We store just the id instead of the whole table. If we want, we can always get the table
// from the database (eg, for drawing).
_rolloff = newvalue;
drawDirectivity();
BROADCAST(this, "ss", "setRolloff", _rolloff.c_str());
}
示例7: BROADCAST
void Listener::setType (const char* t)
{
// only do this if the type has changed:
if (type == std::string(t)) return;
type = std::string(t);
BROADCAST(this, "ss", "setType", getType());
}
示例8: drawGrid
// *****************************************************************************
void GridNode::setSize (int s)
{
if (this->_size != s)
{
this->_size = s;
drawGrid();
BROADCAST(this, "si", "setSize", (int) this->_size);
}
}
示例9: drawShape
void ShapeNode::setBillboard (billboardType t)
{
if (t == billboard) return;
else billboard = t;
drawShape();
BROADCAST(this, "si", "setBillboard", (int) billboard);
}
示例10: updateStateSet
void ShapeNode::setStateSetFromFile(const char* filename)
{
osg::ref_ptr<ReferencedStateSet> ss = sceneManager->createStateSet(filename);
if (ss.valid())
{
if (ss->id == stateset) return; // we're already using that stateset
stateset = ss->id;
updateStateSet();
BROADCAST(this, "ss", "setStateSet", getStateSet());
}
}
示例11: isc__taskmgr_resume
ISC_TASKFUNC_SCOPE void
isc__taskmgr_resume(isc_taskmgr_t *manager0) {
isc__taskmgr_t *manager = (isc__taskmgr_t *)manager0;
LOCK(&manager->lock);
if (manager->pause_requested) {
manager->pause_requested = ISC_FALSE;
BROADCAST(&manager->work_available);
}
UNLOCK(&manager->lock);
}
示例12: getRelativePath
// ===================================================================
void ShapeNode::setTextureFromFile (const char* s)
{
string path = getRelativePath(string(s));
// don't do anything if the current texture is already loaded:
if (path==texturePath) return;
else texturePath=path;
//drawTexture();
BROADCAST(this, "ss", "setTextureFromFile", texturePath.c_str());
}
示例13: BROADCAST
void GeometryNode::setSingleSided (int singleSided)
{
singleSided_ = singleSided;
osg::StateSet *ss = geode_->getOrCreateStateSet();
if (singleSided_)
ss->setMode( GL_CULL_FACE, osg::StateAttribute::ON );
else
ss->setMode( GL_CULL_FACE, osg::StateAttribute::OFF );
BROADCAST(this, "si", "setSingleSided", getSingleSided());
}
示例14: isc_task_endexclusive
void
isc_task_endexclusive(isc_task_t *task) {
#ifdef ISC_PLATFORM_USETHREADS
isc_taskmgr_t *manager = task->manager;
REQUIRE(task->state == task_state_running);
LOCK(&manager->lock);
REQUIRE(manager->exclusive_requested);
manager->exclusive_requested = ISC_FALSE;
BROADCAST(&manager->work_available);
UNLOCK(&manager->lock);
#else
UNUSED(task);
#endif
}
示例15: SoundConnection
// *****************************************************************************
void DSPNode::connect(DSPNode *snk)
{
// check if this connection already exists:
if (!this->getConnection(snk))
{
SoundConnection *conn = new SoundConnection(this->sceneManager, this, snk);
// add to the connection lists for each node:
this->connectTO.push_back(conn);
conn->sink->connectFROM.push_back(conn);
}
BROADCAST(this, "ss", "connect", snk->id->s_name);
}