本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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)) );
}
示例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);
}
示例6: Drop
Association::~Association()
{
// drop an existing association on shutdown
if (assoc != NULL)
Drop();
assoc = NULL;
m_pNotificadorProgreso = NULL;
}
示例7: SendWSLStr
void SendWSLStr( char *str ) {
//===============================
while( *str != NULLCHAR ) {
Drop( *str );
++str;
}
}
示例8: Drop
bool ColorPusher::Key(dword key, int)
{
if(key == K_SPACE) {
Drop();
return true;
}
return false;
}
示例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);
}
示例10: WhenLeftDown
void DropGrid::LeftDown(Point p, dword keyflags)
{
WhenLeftDown();
if(nodrop)
SetFocus();
else
Drop();
}
示例11: SendChar
void SendChar( char ch, int rep ) {
//====================================
while( rep > 0 ) {
Drop( ch );
rep--;
}
}
示例12: SendStr
void SendStr( char PGM *str, uint len ) {
//==========================================
while( len > 0 ) {
Drop( *str );
str++;
len--;
}
}
示例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();
};
示例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);
}
示例15: Lock
void cRingBufferFrame::Clear(void)
{
Lock();
cFrame *p;
while ((p = Get()) != NULL)
Drop(p);
Unlock();
EnablePut();
EnableGet();
}