當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。