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

C++ BROADCAST函数代码示例

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

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



在下文中一共展示了BROADCAST函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:each,项目名称:bind9-collab,代码行数:60,代码来源:rwlock.c


示例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());
}
开发者ID:mikewoz,项目名称:spinframework,代码行数:27,代码来源:PointerNode.cpp


示例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());
}
开发者ID:simonec77,项目名称:spinframework,代码行数:7,代码来源:DSPNode.cpp


示例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);
    }
}
开发者ID:mikewoz,项目名称:spinframework,代码行数:34,代码来源:PointerNode.cpp


示例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));
}
开发者ID:OPSF,项目名称:uClinux,代码行数:30,代码来源:task.c


示例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());
}
开发者ID:simonec77,项目名称:spinframework,代码行数:8,代码来源:DSPNode.cpp


示例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());
}
开发者ID:simonec77,项目名称:spinframework,代码行数:8,代码来源:Listener.cpp


示例8: drawGrid

// *****************************************************************************
void GridNode::setSize (int s)
{
	if (this->_size != s)
	{
		this->_size = s;
		drawGrid();
		BROADCAST(this, "si", "setSize", (int) this->_size);
	}
}
开发者ID:djiamnot,项目名称:spinframework,代码行数:10,代码来源:GridNode.cpp


示例9: drawShape

void ShapeNode::setBillboard (billboardType t)
{
	if (t == billboard) return;
	else billboard = t;

	drawShape();

	BROADCAST(this, "si", "setBillboard", (int) billboard);

}
开发者ID:djiamnot,项目名称:spinframework,代码行数:10,代码来源:ShapeNode.cpp


示例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());
	}
}
开发者ID:djiamnot,项目名称:spinframework,代码行数:11,代码来源:ShapeNode.cpp


示例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);
}
开发者ID:execunix,项目名称:vinos,代码行数:11,代码来源:task.c


示例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());
}
开发者ID:djiamnot,项目名称:spinframework,代码行数:13,代码来源:ShapeNode.cpp


示例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());
}
开发者ID:mikewoz,项目名称:spinframework,代码行数:12,代码来源:GeometryNode.cpp


示例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
}
开发者ID:OPSF,项目名称:uClinux,代码行数:14,代码来源:task.c


示例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);
}
开发者ID:simonec77,项目名称:spinframework,代码行数:15,代码来源:DSPNode.cpp


示例16: icmp_send

/* NOTE: icmp dont drop @ipkb */
void icmp_send(unsigned char type, unsigned char code,
		unsigned int data, struct pkbuf *pkb_in)
{
	struct pkbuf *pkb;
	struct ip *iphdr = pkb2ip(pkb_in);
	struct icmp *icmphdr;
	int paylen = _ntohs(iphdr->ip_len);	/* icmp payload length */
	if (paylen < iphlen(iphdr) + 8)
		return;
	/*
	 * RFC 1812 Section 4.3.2.7 for sanity check
	 * An ICMP error message MUST NOT be sent as the result of receiving:
	 * 1. A packet sent as a Link Layer broadcast or multicast
	 * 2. A packet destined to an IP broadcast or IP multicast address
	 *[3] A packet whose source address has a network prefix of zero or is an
	 *      invalid source address (as defined in Section [5.3.7])
	 * 4. Any fragment of a datagram other then the first fragment (i.e., a
	 *      packet for which the fragment offset in the IP header is nonzero).
	 * 5. An ICMP error message
	 */
	if (pkb_in->pk_type != PKT_LOCALHOST)
		return;
	if (MULTICAST(iphdr->ip_dst) || BROADCAST(iphdr->ip_dst))
		return;
	if (iphdr->ip_fragoff & _htons(IP_FRAG_OFF))
		return;

	if (icmp_type_error(type) && iphdr->ip_pro == IP_P_ICMP) {
		icmphdr = ip2icmp(iphdr);
		if (icmphdr->icmp_type > ICMP_T_MAXNUM || icmp_error(icmphdr))
			return;
	}
	/* build icmp packet and send */
	/* ip packet size must be smaller than 576 bytes */
	if (IP_HRD_SZ + ICMP_HRD_SZ + paylen > 576)
		paylen = 576 - IP_HRD_SZ - ICMP_HRD_SZ;
	pkb = alloc_pkb(ETH_HRD_SZ + IP_HRD_SZ + ICMP_HRD_SZ + paylen);
	icmphdr = (struct icmp *)(pkb2ip(pkb)->ip_data);
	icmphdr->icmp_type = type;
	icmphdr->icmp_code = code;
	icmphdr->icmp_cksum = 0;
	icmphdr->icmp_undata = data;
	memcpy(icmphdr->icmp_data, (unsigned char *)iphdr, paylen);
	icmphdr->icmp_cksum =
		icmp_chksum((unsigned short *)icmphdr, ICMP_HRD_SZ + paylen);
	icmpdbg("to "IPFMT"(payload %d) [type %d code %d]\n",
		ipfmt(iphdr->ip_src), paylen, type, code);
	ip_send_info(pkb, 0, IP_HRD_SZ + ICMP_HRD_SZ + paylen,
						0, IP_P_ICMP, iphdr->ip_src);
}
开发者ID:0xcc,项目名称:tapip,代码行数:51,代码来源:icmp.c


示例17: BROADCAST

void ShapeNode::setLighting (int i)
{
	if (lightingEnabled==(bool)i) return;
	lightingEnabled = (bool)i;

	if (shapeGeode.valid() && !stateset->s_thing)
	{
		osg::StateSet *ss = shapeGeode->getOrCreateStateSet();
		if (lightingEnabled) ss->setMode( GL_LIGHTING, osg::StateAttribute::ON );
		else ss->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
	}

	BROADCAST(this, "si", "setLighting", getLighting());

}
开发者ID:djiamnot,项目名称:spinframework,代码行数:15,代码来源:ShapeNode.cpp


示例18: updateVUmeter

void DSPNode::setIntensity (float newvalue)
{
    currentSoundIntensity = newvalue;

    float r = currentSoundIntensity / 0.896909;
    if (r > 1.0) r=1.0;
    float g = (1.0 - currentSoundIntensity) / 0.103091;
    if (g > 1.0) g=1.0;
    currentSoundColor = osg::Vec3(r, g, 0.0);


    updateVUmeter();
    updateLaser();

    BROADCAST(this, "sf", "setIntensity", currentSoundIntensity);
}
开发者ID:simonec77,项目名称:spinframework,代码行数:16,代码来源:DSPNode.cpp


示例19: isc__task_endexclusive

ISC_TASKFUNC_SCOPE void
isc__task_endexclusive(isc_task_t *task0) {
#ifdef USE_WORKER_THREADS
	isc__task_t *task = (isc__task_t *)task0;
	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(task0);
#endif
}
开发者ID:2014-class,项目名称:freerouter,代码行数:16,代码来源:task.c


示例20: getParent

// *****************************************************************************
void ReferencedStateSet::debug()
{
	lo_arg **args;
	int argc;
	char *argTypes;

	std::cout << "****************************************" << std::endl;
	std::cout << "************* STATE DEBUG: *************" << std::endl;

	std::cout << "\nReferencedStateSet: " << id->s_name << ", type: " << classType << std::endl;

	
	std::cout << "   Shared by:";
	for (unsigned i = 0; i < getNumParents(); i++)
		std::cout << " " << getParent(i)->getName();
	std::cout << std::endl;

	//osg::ref_ptr<ReferencedStateSet> test = this;
	//std::cout << "ref_count=" << test->getReferenceCount() << std::endl;
	
	
	vector<lo_message> nodeState = this->getState();
	vector<lo_message>::iterator nodeStateIterator;
	for (nodeStateIterator = nodeState.begin(); nodeStateIterator != nodeState.end(); ++nodeStateIterator)
	{
	    argTypes = lo_message_get_types(*nodeStateIterator);
	    argc = lo_message_get_argc(*nodeStateIterator);
	    args = lo_message_get_argv(*nodeStateIterator);

	    std::cout << "  ";
	    for (int i = 0; i < argc; i++) {
		    std::cout << " ";
	    	if (lo_is_numerical_type((lo_type)argTypes[i]))
	    	{
	    		std::cout << (float) lo_hires_val( (lo_type)argTypes[i], args[i] );
	    	} else if (strlen((char*) args[i])) {
	    		std::cout << (char*) args[i];
	    	} else {
	    		std::cout << "NULL";
	    	}
	    }
	    std::cout << std::endl;
	}
	
	BROADCAST(this, "s", "debug");
}
开发者ID:djiamnot,项目名称:spinframework,代码行数:47,代码来源:ReferencedStateSet.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ BRect函数代码示例发布时间:2022-05-30
下一篇:
C++ BREAK_TO_DEBUGGER函数代码示例发布时间: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