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

C++ Cancel函数代码示例

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

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



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

示例1: Cancel

QWakeUpActiveObject::~QWakeUpActiveObject()
{
    Cancel();
}
开发者ID:NikhilNJ,项目名称:screenplay-dx,代码行数:4,代码来源:qeventdispatcher_symbian.cpp


示例2: UpdateCommandButton

void CUpdateThread::Update()
{
	// 读取本地配置
	UpdateCommandButton(COMMAND_BUTTON_CANCEL);
	UpdateMainProgress(0);
	UpdateSubProgress(0);

	UpdateStatusText(_T("读取站点列表……"));
	CString strIniPath = theApp.GetProfileFile();
	CString strSites;
	DWORD dwSize = 0;
	do 
	{
		dwSize += 4096;
	} while(GetPrivateProfileSection(_T("Sites"), strSites.GetBuffer(dwSize), dwSize, strIniPath.GetString()) == dwSize - 2);
	UpdateSubProgress(100);

	CArray<CString> sites;
	LPCTSTR lpszSite = strSites.GetBuffer();
	while (lpszSite[0]) 
	{
		sites.Add(lpszSite);
		lpszSite += _tcslen(lpszSite) + 1;
	}
	strSites.ReleaseBuffer();

	UpdateMainProgress(2);

	CMap<CString, LPCTSTR, AddonFile, AddonFile&> files;
	// 下载文件列表
	double step = 6.0 / sites.GetSize();
	for (int i = 0; i < sites.GetSize() && CheckCancel(); ++i) 
	{
		CString &strSite = sites.GetAt(i);
		if (!GetFileList(strSite, files))
		{
			UpdateSubProgress(100);
			UpdateMainProgress(100);
			UpdateStatusText(_T("无法下载文件列表。"));
			return;
		}
		UpdateMainProgress(2 + (int)(step * i + 0.5));
	}
	if (!CheckCancel())
		return;
	UpdateMainProgress(8);
		
	UpdateStatusText(_T("正在检测需要更新的文件……"));

	CString strWOWPath = theApp.GetWOWPath();
	CString strTempPath = theApp.GetTempPath();
	CArray <AddonFile *> aDownloadList;
	// 需要下载的文件
	CMap<CString, LPCTSTR, AddonFile, AddonFile&>::CPair *pair = files.PGetFirstAssoc();
	while (pair && CheckCancel())
	{
		CString strMD5;
		try 
		{
			CString strFilePath;
			strFilePath.Append(strWOWPath);
			strFilePath.Append(pair->value.m_strPath);
			md5_state_t md5;
			md5_init(&md5);
			md5_byte_t digest[16] = {0};
			CFile file(strFilePath, CFile::shareDenyRead | CFile::modeRead);
			char buf[4096];
			UINT nCount;
			while ((nCount = file.Read(buf, 4096)) > 0)
			{
				md5_append(&md5, buf, nCount);	
			}
			file.Close();
			md5_finish(&md5, digest);
			for (int i = 0; i < 16; ++i)
			{
				strMD5.AppendFormat(_T("%02x"), digest[i]);
			}
		}
		catch (CFileException *e)
		{
			e->Delete();
		}
		if (strMD5.Compare(pair->value.m_strMD5) != 0)
		{
			aDownloadList.Add(&pair->value);
		}

		pair = files.PGetNextAssoc(pair);
	}

	if (!CheckCancel())
		return;

	ULONG uTotalSize = 0;
	for (int i = 0; i < aDownloadList.GetSize(); ++i)
	{
		uTotalSize += aDownloadList.GetAt(i)->m_uCompressedSize;
	}

//.........这里部分代码省略.........
开发者ID:wyx1987,项目名称:AddonUpdator,代码行数:101,代码来源:UpdateThread.cpp


示例3: Cancel

cDeCsaTSBuffer::~cDeCsaTSBuffer()
{
  Cancel(3);
  if(decsa) decsa->SetActive(false);
  delete ringBuffer;
}
开发者ID:Saner2oo2,项目名称:descrambler,代码行数:6,代码来源:device.c


示例4: Cancel

CSwiTask::~CSwiTask()
	{	
	Cancel();
	}
开发者ID:fedor4ever,项目名称:packaging,代码行数:4,代码来源:SwiTask.cpp


示例5: Cancel

void DtSetModList::CloseCB()
{
   Cancel();
}
开发者ID:osen,项目名称:cdesktopenv,代码行数:4,代码来源:DtSetModList.C


示例6: Cancel

CCheckNetwork::~CCheckNetwork()
{
    Cancel(); // if any request outstanding, calls DoCancel() to cleanup
    delete iTelephony;
    delete iPkg;
}
开发者ID:deepakprabhakara,项目名称:ripplevault,代码行数:6,代码来源:checknetwork.cpp


示例7: Cancel

// -----------------------------------------------------------------------------
// CMyLocationsEngine::~CCalenderNotification()
// default destuctor.
// -----------------------------------------------------------------------------
//
CCalenderNotification::~CCalenderNotification()
{
    Cancel();
    iFsession.Close();
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:10,代码来源:calendernotification.cpp


示例8: __CONNECTIONMULTIPLEXER

// ---------------------------------------------------------------------------
// CNcmReceiver::~CNcmReceiver
// ---------------------------------------------------------------------------
//
CNcmReceiver::~CNcmReceiver()
    {
    __CONNECTIONMULTIPLEXER( "CNcmReceiver::~CNcmReceiver" )

    Cancel();
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:10,代码来源:cncmreceiver.cpp


示例9: Cancel

/**
 *  Standard destructor.
 */
CSmsMessageSend::~CSmsMessageSend()
{
    Cancel();
    delete iSmsEventLogger;
} // CSmsMessageSend::~CSmsMessageSend
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:8,代码来源:smspsend.cpp


示例10: switch

void CSTTrackerConnection::MHFRunL(RHTTPTransaction aTransaction, 
						  			const THTTPEvent& aEvent)
{
	switch (aEvent.iStatus)
	{
		case THTTPEvent::EGotResponseHeaders:
		{
			// HTTP response headers have been received. Use
			// aTransaction.Response() to get the response. However, it's not
			// necessary to do anything with the response when this event occurs.

			LWRITELN(iLog, _L("[Trackerconnection] Got HTTP headers"));
			// Get HTTP status code from header (e.g. 200)
			RHTTPResponse resp = aTransaction.Response();
			TInt status = resp.StatusCode();
			
			if (status != 200) // ERROR, hiba esetén mi legyen? 404-et lekezelni!
			{
				LWRITE(iLog, _L("[Trackerconnection] Error, status = "));
				TBuf<20> numBuf;
				numBuf.Num(status);
				LWRITELN(iLog, numBuf);
				Cancel();
				if (iObserver)
					iObserver->TrackerConnectionFailedL();
				break;
			}

			// Get status text (e.g. "OK")
			HLWRITE(iLog, _L("[Trackerconnection] Status text = "));
			TBuf<32> statusText;
			statusText.Copy(resp.StatusText().DesC());
			HLWRITELN(iLog, statusText);
			
			
			#ifdef LOG_TO_FILE
			RHTTPHeaders headers = 
				aTransaction.Response().GetHeaderCollection();		
			THTTPHdrFieldIter i =
				headers.Fields();
			for (i.First(); !(i.AtEnd()); ++i)
			{
				RStringF header = iSession.StringPool().StringF(i());
				
				if ((header.DesC() == _L8("Content-Type")))
				{
					HLWRITE(iLog, header.DesC());
					HLWRITE(iLog, _L(": "));
					THTTPHdrVal	val;
					headers.GetField(header, 0, val);
					RStringF value = val.StrF();
					HLWRITELN(iLog, value.DesC());
				}
				else
					HLWRITELN(iLog, header.DesC());
			}
						
			#endif
		}
		break;

		case THTTPEvent::EGotResponseBodyData:
		{			
			// Part (or all) of response's body data received. Use 
			// aTransaction.Response().Body()->GetNextDataPart() to get the actual
			// body data.						

			// Get the body data supplier
			MHTTPDataSupplier* body = aTransaction.Response().Body();
			TPtrC8 dataChunk;						

			// GetNextDataPart() returns ETrue, if the received part is the last 
			// one.
			TBool isLast = body->GetNextDataPart(dataChunk);
			
			//iDownloadedSize += dataChunk.Size();						
			
			HLWRITELN(iLog, _L8("[TrackerConnection] HTTP response body chunk received: "));
			HLWRITELN(iLog, dataChunk);
			
			if (iReceiveBuffer)
			{
				HBufC8* temp = HBufC8::NewL(
					iReceiveBuffer->Length() + dataChunk.Length());
				TPtr8 tempPtr(temp->Des());
				tempPtr.Copy(*iReceiveBuffer);
				tempPtr.Append(dataChunk);
				
				delete iReceiveBuffer;
				iReceiveBuffer = temp;
			}
			else
				iReceiveBuffer = dataChunk.AllocL();

			// Always remember to release the body data.
			body->ReleaseData();
		
			// NOTE: isLast may not be ETrue even if last data part received.
			// (e.g. multipart response without content length field)
			// Use EResponseComplete to reliably determine when body is completely
//.........这里部分代码省略.........
开发者ID:Nokia700,项目名称:SymTorrent,代码行数:101,代码来源:STTrackerConnection.cpp


示例11: Cancel

cThread::~cThread()
{
  Cancel(); // just in case the derived class didn't call it
  free(description);
}
开发者ID:nvertigo,项目名称:vdr,代码行数:5,代码来源:thread.c


示例12: Cancel

QMLBackendMonitorAO::~QMLBackendMonitorAO()
{
    Cancel();
    delete iTriggerMonitorInfo; //deletes the CBackendMonitorInfo object holding the linked list
    iLbt.Close();   //closes the subsession
}
开发者ID:RobinD42,项目名称:qt-mobility,代码行数:6,代码来源:qmlbackendmonitorao_s60.cpp


示例13: Cancel

    // Destructor
CPhCltComHandRequestMonitor::~CPhCltComHandRequestMonitor()
    {  
    Cancel();
    }
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:5,代码来源:cphcltcomhandrequestmonitor.cpp


示例14: Cancel

CStateRefAdaptationTimer::~CStateRefAdaptationTimer()
	{
	Cancel();	
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:4,代码来源:stateadaptationref.cpp


示例15: Cancel

CCopyContactsAO::~CCopyContactsAO()
{
	Cancel();
	delete iDatabase;
}
开发者ID:deepakprabhakara,项目名称:ripplevault,代码行数:5,代码来源:copycontactsao.cpp


示例16: Cancel

// ---------------------------------------------------------------------------
// NewL
// ---------------------------------------------------------------------------
//
CSendUiEcomObserver::~CSendUiEcomObserver()
{
    Cancel();
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:8,代码来源:senduiecomobserver.cpp


示例17: Cancel

CCamcTestClient_9::~CCamcTestClient_9 ()
    {
    Cancel();
    delete iCamc;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:5,代码来源:camcTestClient_9.cpp


示例18: LockMe

void JobManager::DoShutdown()
{
  std::vector<InternalJob::Pointer> vec_ToCancel;
  {
    Poco::ScopedLock<Poco::Mutex> LockMe(m_mutex);
    if (m_active)
    {
      m_active = false;
      //cancel all running jobs
      vec_ToCancel.assign(m_running.begin(), m_running.end());
      //clean up
      m_JobQueueSleeping.Clear();
      m_JobQueueWaiting.Clear();
      m_running.clear();
    }
  }

  // Give running jobs a chance to finish. Wait 0.1 seconds for up to 3 times.
  if (!vec_ToCancel.empty())
  {
    for (std::size_t i = 0; i < vec_ToCancel.size(); i++)
    {
      // cancel jobs outside sync block to avoid deadlock
      Cancel(vec_ToCancel[i]);
    }

    for (int waitAttempts = 0; waitAttempts < 3; waitAttempts++)
    {
      Poco::Thread::yield();
      {
        Poco::ScopedLock<Poco::Mutex> LockMe(m_mutex);
        if (m_running.empty())
          break;
      }
      if (DEBUG_SHUTDOWN)
      {
        //  JobManager.debug("Shutdown - job wait cycle #" + (waitAttempts + 1)); 
        std::vector<InternalJob::Pointer> vec_StillRunning;
        {
          Poco::ScopedLock<Poco::Mutex> LockMe(m_mutex);
          vec_StillRunning.assign(m_running.begin(), m_running.end());

          //   if (!vec_StillRunning.empty()) {
          //for (int j = 0; j < stillRunning.length; j++) {
          //  JobManager.debug("\tJob: " + printJobName(stillRunning[j])); //$NON-NLS-1$
          //}
        }
      }
      Poco::Thread::sleep(100);
      Poco::Thread::yield();
    }
    // retrieve list of the jobs that are still running

    {
      Poco::ScopedLock<Poco::Mutex> LockMe(m_mutex);
      vec_ToCancel.assign(m_running.begin(), m_running.end());
    }
  }

  if (!vec_ToCancel.empty())
  {
    /*for (int i = 0; i < vec_ToCancel.size(); i++) {*/
    //  std::string  tmp_jobName = PrintJobName(toCancel[i]);
    //        //this doesn't need to be translated because it's just being logged
    //        String msg = "Job found still running after platform shutdown.  Jobs should be canceled by the plugin that
    //        scheduled them during shutdown: " + jobName;
    //        RuntimeLog.log(new Status(IStatus.WARNING, JobManager.PI_JOBS, JobManager.PLUGIN_ERROR, msg, null));
    //
    //        // TODO the RuntimeLog.log in its current implementation won't produce a log
    //        // during this stage of shutdown. For now add a standard error output.
    //        // One the logging story is improved, the System.err output below can be removed:
    //        System.err.println(msg);
    //      }
  }

  m_Pool->Shutdown();
}
开发者ID:test-fd301,项目名称:MITK,代码行数:77,代码来源:berryJobManager.cpp


示例19: Cancel

void CSocketsWriter::TimerExpired()
    {
	Cancel();
	iWriteStatus = EWaiting;
    iEngineNotifier.ReportError(MEngineNotifier::ETimeOutOnWrite, KErrTimedOut);
    }
开发者ID:AnthonyNystrom,项目名称:MobiVU,代码行数:6,代码来源:SocketsWriter.cpp


示例20: Cancel

// ---------------------------------------------------------------------------
// CSsmLangSelCmd::ExecuteCancel
// ---------------------------------------------------------------------------
//
void CSsmLangSelCmd::ExecuteCancel()
    {
    FUNC_LOG;

    Cancel();
    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:10,代码来源:ssmlangselcmd.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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