本文整理汇总了C++中LIST::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ LIST::remove方法的具体用法?C++ LIST::remove怎么用?C++ LIST::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LIST
的用法示例。
在下文中一共展示了LIST::remove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CB_ReInitCustomButtons
void CB_ReInitCustomButtons()
{
for (int i = 0; i < LButtonsList.getCount(); i++) {
CustomButtonData *cbd = LButtonsList[i];
if (cbd->opFlags & BBSF_NTBSWAPED || cbd->opFlags & BBSF_NTBDESTRUCT) {
cbd->opFlags ^= BBSF_NTBSWAPED;
if (!(cbd->opFlags & BBSF_NTBDESTRUCT))
RButtonsList.insert(cbd);
LButtonsList.remove(i);
i--;
}
}
for (int i = 0; i < RButtonsList.getCount(); i++) {
CustomButtonData* cbd = RButtonsList[i];
if (cbd->opFlags & BBSF_NTBSWAPED || cbd->opFlags & BBSF_NTBDESTRUCT) {
cbd->opFlags ^= BBSF_NTBSWAPED;
if (!(cbd->opFlags & BBSF_NTBDESTRUCT))
LButtonsList.insert(cbd);
RButtonsList.remove(i);
i--;
}
}
M.BroadcastMessage(DM_BBNEEDUPDATE, 0, 0);
M.BroadcastMessage(DM_LOADBUTTONBARICONS, 0, 0);
}
示例2: ScheduleThread
void ScheduleThread(void*)
{
time_t waitTime = INFINITE;
while (true)
{
wait: WaitForSingleObject(hScheduleEvent, waitTime);
while (ScheduleTask *task = tasks[0])
{
if (Miranda_Terminated())
return;
mir_cslock lock(threadLock);
time_t timestamp = time(NULL);
if (task->timestamp > timestamp)
{
waitTime = (task->timestamp - timestamp - 1) * 1000;
goto wait;
}
tasks.remove(task);
mir_forkthread(ExecuteTaskThread, task);
}
waitTime = INFINITE;
}
}
示例3: ProtoAck
/**
* Protocols àcknowledgement
*/
int ProtoAck(WPARAM wparam,LPARAM lparam)
{
ACKDATA *pAck = (ACKDATA *)lparam;
if (pAck->type != ACKTYPE_MESSAGE || pAck->result != ACKRESULT_SUCCESS)
return 0;
MESSAGE_PROC* p = arMessageProcs.find((MESSAGE_PROC*)&pAck->hProcess);
if (p == NULL)
return 0;
if (iSendAndHistory > 0){
time_t ltime;
time(<ime);
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = "yaRelay";
dbei.timestamp = ltime;
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.cbBlob = (DWORD)strlen(p->msgText) + 1;
dbei.pBlob = (PBYTE)p->msgText;
db_event_add(hForwardTo, &dbei);
}
mir_free(p->msgText);
arMessageProcs.remove(p);
mir_free(p);
return 0;
}
示例4: GetCurrentThreadId
MIR_CORE_DLL(INT_PTR) Thread_Pop()
{
if (WaitForSingleObject(hStackMutex, INFINITE) == WAIT_OBJECT_0) {
DWORD dwThreadId = GetCurrentThreadId();
for (int j = 0; j < threads.getCount(); j++) {
THREAD_WAIT_ENTRY *p = threads[j];
if (p->dwThreadId == dwThreadId) {
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
CloseHandle(p->hThread);
threads.remove(j);
mir_free(p);
if (!threads.getCount()) {
threads.destroy();
ReleaseMutex(hStackMutex);
SetEvent(hThreadQueueEmpty); // thread list is empty now
return 0;
}
ReleaseMutex(hStackMutex);
return 0;
}
}
ReleaseMutex(hStackMutex);
}
return 1;
}
示例5: wipeList
static void wipeList(LIST<CustomButtonData> &list)
{
for (int i = list.getCount()-1; i >= 0; i--) {
delete list[i];
list.remove(i);
}
}
示例6: sametime_proto_uninit
static int sametime_proto_uninit(PROTO_INTERFACE* ppro)
{
CSametimeProto* proto = (CSametimeProto*)ppro;
g_Instances.remove(proto);
delete proto;
return 0;
}
示例7: yahooProtoUninit
static int yahooProtoUninit( CYahooProto* ppro )
{
g_instances.remove( ppro );
delete ppro;
return 0;
}
示例8: OnMsgWndEvent
//hookProc ME_MSG_WINDOWEVENT
static int OnMsgWndEvent(WPARAM, LPARAM lParam)
{
MsgWndData *msgwnd;
MessageWindowEventData *msgwe = (MessageWindowEventData*)lParam;
/* sanity check */
if (msgwe->hContact == NULL)
return 0;
switch (msgwe->uType) {
case MSG_WINDOW_EVT_OPENING:
msgwnd = gMsgWndList.find((MsgWndData*)&msgwe->hContact);
if (msgwnd == NULL) {
msgwnd = new MsgWndData(msgwe->hwndWindow, msgwe->hContact);
gMsgWndList.insert(msgwnd);
}
break;
case MSG_WINDOW_EVT_CLOSE:
int i = gMsgWndList.getIndex((MsgWndData*)&msgwe->hContact);
if (i != -1) {
delete gMsgWndList[i];
gMsgWndList.remove(i);
}
break;
}
return 0;
}
示例9: msgQueue_processack
void msgQueue_processack(MCONTACT hContact, int id, BOOL success, const char* szErr)
{
MCONTACT hMeta = db_mc_getMeta(hContact);
mir_cslockfull lck(csMsgQueue);
for (int i = 0; i < msgQueue.getCount(); i++) {
TMsgQueue *item = msgQueue[i];
if ((item->hContact == hContact || item->hContact == hMeta) && item->id == id) {
msgQueue.remove(i); i--;
if (!msgQueue.getCount() && timerId) {
KillTimer(NULL, timerId);
timerId = 0;
}
lck.unlock();
if (success) {
mir_free(item->szMsg);
mir_free(item);
}
else MessageFailureProcess(item, szErr);
break;
}
}
}
示例10: DefWindowProc
static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PopupWnd2 *wnd = NULL;
if (message == UTM_ADD_WINDOW || message == UTM_UPDATE_WINDOW || message == UTM_REMOVE_WINDOW || message == UTM_REQUEST_REMOVE)
if (!(wnd = (PopupWnd2 *)lParam))
return 0;
switch (message) {
case UTM_STOP_THREAD:
gTerminating = true;
if (db_get_b(NULL, MODULNAME, "FastExit", 0))
for (int i = 0; i < popupList.getCount(); ++i)
PUDeletePopup(popupList[i]->getHwnd());
PostQuitMessage(0);
break;
case UTM_ADD_WINDOW:
if (gTerminating)
break;
UpdatePopupPosition(popupList.getCount() ? popupList[popupList.getCount() - 1] : 0, wnd);
popupList.insert(wnd);
++nPopups;
wnd->callMethodAsync(&PopupWnd2::m_show, 0);
break;
case UTM_UPDATE_WINDOW:
RepositionPopups();
break;
case UTM_REQUEST_REMOVE:
if ((PopupOptions.LeaveHovered && gLockCount) || (wnd && wnd->isLocked()))
wnd->updateTimer();
else
PostMessage(wnd->getHwnd(), WM_CLOSE, 0, 0);
break;
case UTM_REMOVE_WINDOW:
{
for (int i = popupList.getCount() - 1; i >= 0; i--)
if (popupList[i] == wnd)
popupList.remove(i);
}
RepositionPopups();
--nPopups;
delete wnd;
break;
case UTM_LOCK_QUEUE:
++gLockCount;
break;
case UTM_UNLOCK_QUEUE:
if (--gLockCount < 0)
gLockCount = 0;
break;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
示例11: i
int
main() {
LIST<int> list;
print_list(list);
list.append(10);
print_list(list);
list.append(20);
print_list(list);
list.prepend(30);
print_list(list);
list.prepend(20);
print_list(list);
list.append(40);
print_list(list);
LIST<int>::ITERATOR i(list);
while(!i.done()) {
LIST<int>::NODE* node = (*i);
i++;
if(node->data() == 20) {
list.remove(node);
}
}
print_list(list);
i = LIST<int>::ITERATOR(list);
while(!i.done()) {
LIST<int>::NODE* node = (*i);
i++;
list.remove(node);
}
print_list(list);
return 0;
}
示例12: KillModuleTTBButton
void KillModuleTTBButton()
{
while (TBButtons.getCount())
{
HANDLE hTTButton = TBButtons[0];
::CallService(MS_TTB_REMOVEBUTTON, (WPARAM)hTTButton, 0);
TBButtons.remove(0);
}
}
示例13: Close
HRESULT ISmileyBase::Close(DWORD /* dwSaveOption */)
{
regSmileys.remove(this);
if (m_spAdviseSink) m_spAdviseSink->Release();
m_spAdviseSink = NULL;
return S_OK;
}
示例14: amGetCurrentChain
/*
* Gets handle from queue for request
*/
static MCONTACT amGetCurrentChain()
{
mir_cslock lck(amCS);
if (amItems.getCount() == 0)
return NULL;
MCONTACT res = (MCONTACT)amItems[0];
amItems.remove(0);
return res;
}
示例15: KillModuleScheduleTasks
void KillModuleScheduleTasks()
{
mir_cslock lock(threadLock);
while (ScheduleTask *task = tasks[0])
{
tasks.remove(task);
DestroyTask(task);
}
}