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

C++ Pass函数代码示例

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

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



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

示例1: log_buff

static Action_SkBuff
log_buff(arguments_t args, SkBuff b)
{
	if (!printk_ratelimit())
		return Pass(b);

	printk(KERN_INFO "[PFQ/lang] [%p] len=%u head=%u tail=%u\n", b.skb,
								b.skb->len,
								skb_headroom(b.skb),
								skb_tailroom(b.skb));

	printk(KERN_INFO "      [%p] %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x...\n",
				b.skb->data,
				b.skb->data[0],
				b.skb->data[1],
				b.skb->data[2],
				b.skb->data[3],
				b.skb->data[4],
				b.skb->data[5],
				b.skb->data[6],
				b.skb->data[7],
				b.skb->data[8],
				b.skb->data[9],
				b.skb->data[10],
				b.skb->data[11],
				b.skb->data[12],
				b.skb->data[13]);

	return Pass(b);
}
开发者ID:jkhoogland,项目名称:PFQ,代码行数:30,代码来源:misc.c


示例2: timeit

void timeit()
{
  Create(SYSCALL_LOW, timerecvrep);
  Pass();
  Create(SYSCALL_LOW, timesend);
  Pass();
  Exit();
}
开发者ID:kspaans,项目名称:StrombolOS,代码行数:8,代码来源:user.c


示例3: log_packet

static Action_SkBuff
log_packet(arguments_t args, SkBuff b)
{
	if (!printk_ratelimit())
		return Pass(b);

	if (eth_hdr(b.skb)->h_proto == __constant_htons(ETH_P_IP))
	{
		struct iphdr _iph;
		const struct iphdr *ip;

		ip = skb_header_pointer(b.skb, b.skb->mac_len, sizeof(_iph), &_iph);
		if (ip == NULL)
			return Pass(b);

		switch(ip->protocol)
		{
		case IPPROTO_UDP: {
			struct udphdr _udph; const struct udphdr *udp;
			udp = skb_header_pointer(b.skb, b.skb->mac_len + (ip->ihl<<2), sizeof(struct udphdr), &_udph);
			if (udp == NULL)
				return Pass(b);

			printk(KERN_INFO "[PFQ/lang] IP %pI4.%d > %pI4.%d: UDP\n",
						&ip->saddr, ntohs(udp->source),
						&ip->daddr, ntohs(udp->dest));
			return Pass(b);
		}
		case IPPROTO_TCP: {
			struct tcphdr _tcph; const struct tcphdr *tcp;
			tcp = skb_header_pointer(b.skb, b.skb->mac_len + (ip->ihl<<2), sizeof(struct tcphdr), &_tcph);
			if (tcp == NULL)
				return Pass(b);

			printk(KERN_INFO "[PFQ/lang] IP %pI4.%d > %pI4.%d: TCP\n", &ip->saddr, ntohs(tcp->source),
									      &ip->daddr, ntohs(tcp->dest));
			return Pass(b);
		}
		case IPPROTO_ICMP: {

			printk(KERN_INFO "[PFQ/lang] IP %pI4 > %pI4: ICMP\n", &ip->saddr, &ip->daddr);
			return Pass(b);
		}
		default: {

			printk(KERN_INFO "[PFQ/lang] IP %pI4 > %pI4: proto %x\n", &ip->saddr, &ip->daddr,
									     ip->protocol);
			return Pass(b);
		}

		}

	} else
		printk(KERN_INFO "[PFQ/lang] ETH proto %x\n", ntohs(eth_hdr(b.skb)->h_proto));

        return Pass(b);
}
开发者ID:jkhoogland,项目名称:PFQ,代码行数:57,代码来源:misc.c


示例4: crc16_sum

static ActionSkBuff
crc16_sum(arguments_t args, SkBuff skb)
{
	u16 crc = crc16(0, (u8 const *)eth_hdr(PFQ_SKB(skb)), skb->len);
	set_state(skb, crc);
        return Pass(skb);
}
开发者ID:pandaychen,项目名称:PFQ,代码行数:7,代码来源:misc.c


示例5: Execute

int TrimCommand ::	Execute( ALib::CommandLine & cmd ) {

    GetSkipOptions( cmd );
    if ( cmd.HasFlag( FLAG_TRLEAD ) || cmd.HasFlag( FLAG_TRTRAIL ) ) {
        mTrimLead = cmd.HasFlag( FLAG_TRLEAD );
        mTrimTrail = cmd.HasFlag( FLAG_TRTRAIL );
    }
    else {
        mTrimLead = mTrimTrail = true;
    }

    if ( cmd.HasFlag( FLAG_WIDTH ) ) {
        GetWidths( cmd.GetValue( FLAG_WIDTH ) );
    }

    ALib::CommaList cl( cmd.GetValue( FLAG_COLS, "" ) );
    CommaListToIndex( cl, mFields );

    IOManager io( cmd );
    CSVRow row;

    while( io.ReadCSV( row ) ) {
        if ( Skip( row ) ) {
            continue;
        }

        if ( ! Pass( row ) ) {
            Trim( row );
        }
        io.WriteRow( row );
    }

    return 0;
}
开发者ID:purinda,项目名称:csvfix,代码行数:34,代码来源:csved_trim.cpp


示例6: bloom_dst_filter

static ActionQbuff
bloom_dst_filter(arguments_t args, struct qbuff * buff)
{
	if (bloom_dst(args, buff))
		return Pass(buff);
	return Drop(buff);
}
开发者ID:pfq,项目名称:PFQ,代码行数:7,代码来源:bloom.c


示例7: removeAllPasses

    //-----------------------------------------------------------------------------
    Technique& Technique::operator=(const Technique& rhs)
    {
        mName = rhs.mName;
		this->mIsSupported = rhs.mIsSupported;
        this->mLodIndex = rhs.mLodIndex;
		this->mSchemeIndex = rhs.mSchemeIndex;
		this->mShadowCasterMaterial = rhs.mShadowCasterMaterial;
		this->mShadowCasterMaterialName = rhs.mShadowCasterMaterialName;
		this->mShadowReceiverMaterial = rhs.mShadowReceiverMaterial;
		this->mShadowReceiverMaterialName = rhs.mShadowReceiverMaterialName;
		this->mGPUVendorRules = rhs.mGPUVendorRules;
		this->mGPUDeviceNameRules = rhs.mGPUDeviceNameRules;

		// copy passes
		removeAllPasses();
		Passes::const_iterator i, iend;
		iend = rhs.mPasses.end();
		for (i = rhs.mPasses.begin(); i != iend; ++i)
		{
			Pass* p = OGRE_NEW Pass(this, (*i)->getIndex(), *(*i));
			mPasses.push_back(p);
		}
        // Compile for categorised illumination on demand
        clearIlluminationPasses();
        mIlluminationPassesCompilationPhase = IPS_NOT_COMPILED;
		return *this;
    }
开发者ID:RoboticOxygen,项目名称:extramegablob,代码行数:28,代码来源:OgreTechnique.cpp


示例8: RPSClient_Start

void RPSClient_Start() {
	robprintfbusy((const unsigned char *)"RPSClient created, tid=%d\n", MyTid());
	RPSClient client;
	RPSClient_Initialize(&client);

	// Want to play
	robprintfbusy((const unsigned char *)"Client: %d - I want to play\n", client.tid);

	RPSMessage * send_message;
	RPSMessage * reply_message;

	send_message = (RPSMessage *) client.send_buffer;
	send_message->message_type= MESSAGE_TYPE_SIGN_UP;
	Send(client.server_id, client.send_buffer, MESSAGE_SIZE, client.reply_buffer,MESSAGE_SIZE);
	reply_message = (RPSMessage *) client.reply_buffer;

	assert(reply_message->message_type == MESSAGE_TYPE_SIGN_UP_OK, "Client didn't sign up successfully");

	int i;
	for (i = 0; i < client.num_rounds_to_play; i++) {
		RPSClient_PlayARound(&client);
		Pass();
		if (!client.running) {
			robprintfbusy((const unsigned char *)"Client: %d - Quiting due to server shutdown\n", client.tid);
			Exit();
		}
	}

	RPSClient_Quit(&client);

	Exit();
}
开发者ID:RobertElder,项目名称:CS452,代码行数:32,代码来源:rps.c


示例9: Execute

int EditCommand :: Execute( ALib::CommandLine & cmd ) {

	GetSkipOptions( cmd );
	for ( int i = 2; i < cmd.Argc(); i++ ) {
		if ( cmd.Argv( i ) == FLAG_EDIT ) {
			AddSubCmd( cmd.Argv( i + 1 ) );
			i++;
		}
	}

	ALib::CommaList cl( cmd.GetValue( FLAG_COLS, "" ) );
	CommaListToIndex( cl, mCols );

	IOManager io( cmd );
	CSVRow row;

	while( io.ReadCSV( row ) ) {
		if ( Skip( io, row ) ) {
			continue;
		}
		if ( ! Pass( io, row ) ) {
			EditRow( row );
		}
		io.WriteRow( row );
	}

	return 0;
}
开发者ID:bminossi,项目名称:csvfix,代码行数:28,代码来源:csved_edit.cpp


示例10: RPSServer_ProcessMessage

void RPSServer_ProcessMessage(RPSServer * server) {
	RPSMessage * receive_message;
	int source_tid;
	Receive(&source_tid, server->receive_buffer, MESSAGE_SIZE);
	receive_message = (RPSMessage*)server->receive_buffer;

	switch (receive_message->message_type) {
	case MESSAGE_TYPE_SIGN_UP:
		RPSServer_HandleSignup(server, receive_message, source_tid);
		break;
	case MESSAGE_TYPE_QUIT:
		RPSServer_HandleQuit(server, receive_message, source_tid);
		break;
	case MESSAGE_TYPE_PLAY:
		RPSServer_HandlePlay(server, receive_message, source_tid);
		break;
	default:
		assert(0, "RPSServer: Unknown message type from client");
		break;
	}

	RPSServer_SelectPlayers(server);

	Pass();

	if (Queue_CurrentCount(&server->player_tid_queue) == 0) {
		server->running = 0;
	}
}
开发者ID:RobertElder,项目名称:CS452,代码行数:29,代码来源:rps.c


示例11: Execute

int DateReadCommand :: Execute( ALib::CommandLine & cmd ) {

    GetSkipOptions( cmd );
    ProcessFlags( cmd );

    IOManager io( cmd );
    CSVRow row;

    while( io.ReadCSV( row ) ) {

        if ( Skip( io, row ) ) {
            continue;
        }
        if( Pass( io, row ) ) {
            io.WriteRow( row );
            continue;
        }

        if ( ConvertDates( row ) ) {
            io.WriteRow( row );
        }
    }

    return 0;
}
开发者ID:moissinac,项目名称:csvfix,代码行数:25,代码来源:csved_date.cpp


示例12: Execute

int EvalCommand ::	Execute( ALib::CommandLine & cmd ) {

	GetSkipOptions( cmd );
	IOManager io( cmd );
	CSVRow row;

	mDiscardInput = cmd.HasFlag( FLAG_DISCARD );
	GetExpressions( cmd );

	while( io.ReadCSV( row ) ) {
		if ( Skip( io, row ) ) {
			continue;
		}
		if ( ! Pass( io, row ) ) {
			SetParams( row, io );
			if ( mDiscardInput ) {
				row.clear();
			}
			Evaluate( row );
		}

		io.WriteRow( row );
	}

	return 0;
}
开发者ID:bminossi,项目名称:csvfix,代码行数:26,代码来源:csved_eval.cpp


示例13: other_task

void other_task() {
	int mytid = MyTid();
	int myparenttid = MyParentTid();
	bwprintf( COM2, "My tid: %d\tMy parent tid:%d\n\r", mytid, myparenttid);
	Pass();
	bwprintf( COM2, "My tid: %d\tMy parent tid:%d\n\r", mytid, myparenttid);
	Exit();
}
开发者ID:Insecurity-plan15,项目名称:rpavlovs-microkernel,代码行数:8,代码来源:a1.c


示例14: filter_dst_addr

static ActionSkBuff
filter_dst_addr(arguments_t args, SkBuff b)
{
	__be32 addr = GET_ARG_0(__be32, args);
	__be32 mask = GET_ARG_1(__be32, args);

	return has_dst_addr(b, addr, mask) ? Pass(b) : Drop(b);
}
开发者ID:pandaychen,项目名称:PFQ,代码行数:8,代码来源:filter.c


示例15: crc16_sum

static Action_SkBuff
crc16_sum(arguments_t args, SkBuff b)
{
	u16 crc = crc16(0, (u8 const *)eth_hdr(b.skb), b.skb->len);
	set_state(b, crc);

        return Pass(b);
}
开发者ID:jkhoogland,项目名称:PFQ,代码行数:8,代码来源:misc.c


示例16: other_user_task

void other_user_task()
{
  bwprintf(COM2, "My TID is %d and my parent's TID is %d.\n",
           MyTid(), MyParentTid());
  Pass();
  bwprintf(COM2, "My TID is %d and my parent's TID is %d.\n",
           MyTid(), MyParentTid());
  Exit();
}
开发者ID:kspaans,项目名称:StrombolOS,代码行数:9,代码来源:user.c


示例17: max_depth_

AABBTree::AABBTree(const std::vector<Object*> &e, unsigned int max_depth) :
    max_depth_(max_depth) {
  int i;
  // We copy the vector of objects
  for (i = 0; i < e.size(); i++) {
    world_.push_back(e[i]);
  }
  root_ = Pass(world_, NULL, 0);
}
开发者ID:bntmorgan,项目名称:l2,代码行数:9,代码来源:aabbtree.cpp


示例18: task_codes

void task_codes (){

	kprintf("Task id: %d\tParent task id: %d\n\r", MyTid(), MyParentTid());
	Pass();
	kprintf("Task id: %d\tParent task id: %d\n\r", MyTid(), MyParentTid());
	
	Exit();
	kprintf ("Unexpected return from Exit() at task_codes\n\r");
}
开发者ID:ohasanliUW,项目名称:TrainControlSystem,代码行数:9,代码来源:first_task.c


示例19: overflow

int overflow(int times){
	robprintfbusy((const unsigned char *)"Doing overflow in task %d with time as %d\n",times, MyTid());
	int i = 0;
	Pass();
	if(times != 0){
		i = 1 + overflow(times-1);
		return i;
	}
	return i-1;
}
开发者ID:RobertElder,项目名称:CS452,代码行数:10,代码来源:tasks.c


示例20:

void	CBlender_Compile::PassSET_ZB		(BOOL bZTest, BOOL bZWrite, BOOL bInvertZTest)
{
	if (Pass())	bZWrite = FALSE;
	RS.SetRS	(D3DRS_ZFUNC,			bZTest?(bInvertZTest?D3DCMP_GREATER:D3DCMP_LESSEQUAL):D3DCMP_ALWAYS);
	RS.SetRS	(D3DRS_ZWRITEENABLE,	BC(bZWrite));
	/*
	if (bZWrite || bZTest)				RS.SetRS	(D3DRS_ZENABLE,	D3DZB_TRUE);
	else								RS.SetRS	(D3DRS_ZENABLE,	D3DZB_FALSE);
	*/
}
开发者ID:2asoft,项目名称:xray-16,代码行数:10,代码来源:Blender_Recorder.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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