当前位置: 首页>>代码示例>>C++>>正文


C++ Drop函数代码示例

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


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

示例1: net_tcp_send

int CNetConsole::Update()
{
    NETSOCKET Socket;
    NETADDR Addr;

    if(net_tcp_accept(m_Socket, &Socket, &Addr) > 0)
    {
        // check if we just should drop the packet
        char aBuf[128];
        if(NetBan() && NetBan()->IsBanned(&Addr, aBuf, sizeof(aBuf)))
        {
            // banned, reply with a message and drop
            net_tcp_send(Socket, aBuf, str_length(aBuf));
            net_tcp_close(Socket);
        }
        else
            AcceptClient(Socket, &Addr);
    }

    for(int i = 0; i < NET_MAX_CONSOLE_CLIENTS; i++)
    {
        if(m_aSlots[i].m_Connection.State() == NET_CONNSTATE_ONLINE)
            m_aSlots[i].m_Connection.Update();
        if(m_aSlots[i].m_Connection.State() == NET_CONNSTATE_ERROR)
            Drop(i, m_aSlots[i].m_Connection.ErrorString());
    }

    return 0;
}
开发者ID:CytraL,项目名称:MineTee,代码行数:29,代码来源:network_console.cpp

示例2: IssueEvent

	/// @brief Performs upkeep logic
	/// @param bPressed If true, there is a press
	void Widget::Upkeep (bool bPressed)
	{
		IssueEvent(ePreUpkeep);

		// Perform leave logic.
		Leave();

		// If the widget is signaled, perform enter logic; on a press, perform grab logic.
		if (IsSignaled())
		{
			Enter();

			if (bPressed) Grab();
		}

		// If there is no press, perform drop logic.
		if (!bPressed) Drop();

		// If the widget remains chosen, post-process it; otherwise, abandon it.
		if (!IsSignaled() && !IsChosen())
		{
			mState->ClearChoice();

			IssueEvent(eAbandon);
		}

		else IssueEvent(ePostUpkeep);
	}
开发者ID:ggcrunchy,项目名称:bounce-testing,代码行数:30,代码来源:Widget_Imp.cpp

示例3: dbg_msg

int CNetServer::Send(CNetChunk *pChunk)
{
	if(pChunk->m_DataSize >= NET_MAX_PAYLOAD)
	{
		dbg_msg("netserver", "packet payload too big. %d. dropping packet", pChunk->m_DataSize);
		return -1;
	}

	if(pChunk->m_Flags&NETSENDFLAG_CONNLESS)
	{
		// send connectionless packet
		CNetBase::SendPacketConnless(m_Socket, &pChunk->m_Address, pChunk->m_pData, pChunk->m_DataSize);
	}
	else
	{
		int Flags = 0;
		dbg_assert(pChunk->m_ClientID >= 0, "errornous client id");
		dbg_assert(pChunk->m_ClientID < MaxClients(), "errornous client id");

		if(pChunk->m_Flags&NETSENDFLAG_VITAL)
			Flags = NET_CHUNKFLAG_VITAL;

		if(m_aSlots[pChunk->m_ClientID].m_Connection.QueueChunk(Flags, pChunk->m_DataSize, pChunk->m_pData) == 0)
		{
			if(pChunk->m_Flags&NETSENDFLAG_FLUSH)
				m_aSlots[pChunk->m_ClientID].m_Connection.Flush();
		}
		else
		{
			Drop(pChunk->m_ClientID, "Error sending data");
		}
	}
	return 0;
}
开发者ID:123pikapokapei,项目名称:HClient,代码行数:34,代码来源:network_server.cpp

示例4: PrefAssert

void LocalPrefServer::processDrop(CardsSet drop, BidType bid, int playerNum)
{
	// Checking validness of move
	if(mapModelToRealPlayer(model->PlayerCardsOwner(model->CurrentPlayer())) != playerNum) {
		players[playerNum].Player->OnMessage(ErrorMessage("Not your turn"));
		return;
	}

	if( !model->IsValidDrop(Drop(drop, bid)) ) {
		players[playerNum].Player->OnMessage(ErrorMessage("Invalid move"));
		players[playerNum].Player->OnMessage(MoveRequestMessage());
		return;
	}

	// Updating state
	PrefAssert( model->ProcessDrop(Drop(drop, bid)) );
}
开发者ID:eshavlyugin,项目名称:Preferans,代码行数:17,代码来源:LocalPrefServer.cpp

示例5: steering_vlan_id

static Action_SkBuff
steering_vlan_id(arguments_t args, SkBuff b)
{
        if (b.skb->vlan_tci & VLAN_VID_MASK)
 	        return Steering(b, b.skb->vlan_tci & VLAN_VID_MASK);
        else
                return Drop(b);
}
开发者ID:dazer-chen,项目名称:PFQ,代码行数:8,代码来源:steering.c

示例6: Drop

Association::~Association()
{
        // drop an existing association on shutdown
        if (assoc != NULL)
                Drop();
        assoc = NULL;
        m_pNotificadorProgreso = NULL;
}
开发者ID:151706061,项目名称:ginkgocadx,代码行数:8,代码来源:dicomassociation.cpp

示例7: SendWSLStr

void    SendWSLStr( char *str ) {
//===============================

    while( *str != NULLCHAR ) {
        Drop( *str );
        ++str;
    }
}
开发者ID:Graham-stott,项目名称:open-watcom-v2,代码行数:8,代码来源:wrutils.c

示例8: Drop

bool ColorPusher::Key(dword key, int)
{
	if(key == K_SPACE) {
		Drop();
		return true;
	}
	return false;
}
开发者ID:pedia,项目名称:raidget,代码行数:8,代码来源:ColorPusher.cpp

示例9: 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

示例10: WhenLeftDown

void DropGrid::LeftDown(Point p, dword keyflags)
{
	WhenLeftDown();
	if(nodrop)
		SetFocus();
	else
		Drop();	
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:8,代码来源:DropGrid.cpp

示例11: SendChar

void    SendChar( char ch, int rep ) {
//====================================

    while( rep > 0 ) {
        Drop( ch );
        rep--;
    }
}
开发者ID:Graham-stott,项目名称:open-watcom-v2,代码行数:8,代码来源:wrutils.c

示例12: SendStr

void    SendStr( char PGM *str, uint len ) {
//==========================================

    while( len > 0 ) {
        Drop( *str );
        str++;
        len--;
    }
}
开发者ID:Graham-stott,项目名称:open-watcom-v2,代码行数:9,代码来源:wrutils.c

示例13: Equip

void InventoryContainer::OnButtonEvent(std::string selection){
	if(selection == "Equip")
		Equip();
	else if(selection == "Drop")
		Drop();
	else if(selection == "Deposit")
		Deposit();
	else if(selection == "Barter")
		Barter();
};
开发者ID:zachprinz,项目名称:2D_Graphics_Study,代码行数:10,代码来源:InventoryContainer.cpp

示例14: filter_generic

static ActionSkBuff
filter_generic(arguments_t args, SkBuff b)
{
	predicate_t pred_ = GET_ARG(predicate_t, args);

	if (EVAL_PREDICATE(pred_, b))
		return Pass(b);

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

示例15: Lock

void cRingBufferFrame::Clear(void)
{
  Lock();
  cFrame *p;
  while ((p = Get()) != NULL)
        Drop(p);
  Unlock();
  EnablePut();
  EnableGet();
}
开发者ID:flensrocker,项目名称:vdr,代码行数:10,代码来源:ringbuffer.c


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