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

C++ IsStopped函数代码示例

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

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



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

示例1: while

void ArticleCache::Run()
{
	// automatically flush the cache if it is filled to 90% (only in DirectWrite mode)
	size_t fillThreshold = (size_t)g_Options->GetArticleCache() * 1024 * 1024 / 100 * 90;

	int resetCounter = 0;
	bool justFlushed = false;
	while (!IsStopped() || m_allocated > 0)
	{
		if ((justFlushed || resetCounter >= 1000 || IsStopped() ||
			 (g_Options->GetDirectWrite() && m_allocated >= fillThreshold)) &&
			m_allocated > 0)
		{
			justFlushed = CheckFlush(m_allocated >= fillThreshold);
			resetCounter = 0;
		}
		else if (!m_allocated)
		{
			Guard guard(m_allocMutex);
			m_allocCond.Wait(m_allocMutex, [&]{ return IsStopped() || m_allocated > 0; });
			resetCounter = 0;
		}
		else
		{
			Util::Sleep(5);
			resetCounter += 5;
		}
	}
}
开发者ID:nzbget,项目名称:nzbget,代码行数:29,代码来源:ArticleWriter.cpp


示例2: debug

void NntpServer::Run()
{
	debug("Entering NntpServer-loop");

	info("Listening on port %i", m_port);

#ifdef WIN32
	if (m_speed > 0)
	{
		timeBeginPeriod(1);
	}
#endif

	int num = 1;

	while (!IsStopped())
	{
		bool bind = true;

		if (!m_connection)
		{
			m_connection = std::make_unique<Connection>(m_host, m_port, m_secureCert);
			m_connection->SetTimeout(10);
			m_connection->SetSuppressErrors(false);
			bind = m_connection->Bind();
		}

		// Accept connections and store the new Connection
		std::unique_ptr<Connection> acceptedConnection;
		if (bind)
		{
			acceptedConnection = m_connection->Accept();
		}
		if (!bind || !acceptedConnection)
		{
			// Server could not bind or accept connection, waiting 1/2 sec and try again
			if (IsStopped())
			{
				break;
			}
			m_connection.reset();
			usleep(500 * 1000);
			continue;
		}
		
		NntpProcessor* commandThread = new NntpProcessor(num++, m_id, m_dataDir,
			m_cacheDir, m_secureCert, m_secureKey, m_latency, m_speed, m_cache);
		commandThread->SetAutoDestroy(true);
		commandThread->SetConnection(std::move(acceptedConnection));
		commandThread->Start();
	}

	if (m_connection)
	{
		m_connection->Disconnect();
	}

	debug("Exiting NntpServer-loop");
}
开发者ID:sanderjo,项目名称:nzbget,代码行数:59,代码来源:NntpServer.cpp


示例3: ChangeMoveType

void CSoldierBase::MoveCommon()
{
	//目標地点へ移動(中腰)
	if( m_sTargetPosition < m_sPositionX )	//+800
	{
		m_sMoveX = -4;
		m_sDir = DIR_LEFT;
		if( IsStopped() && IsLanding() )
		{
//			if( pGame->pBg->get_kabetype(m_pObj->pos.x/100-0*1,m_pObj->pos.y/100) == 0
//				&& viiSub::IsGroundBlock(m_pObj->pos.x/100-0*1,m_pObj->pos.y/100) )
			if( pGame->pBg->get_kabetype(m_pObj->pos.x/100-1*1,m_pObj->pos.y/100-8*0) == 1
			&&  pGame->pBg->get_kabetype(m_pObj->pos.x/100-1*1,m_pObj->pos.y/100-8*1) == 1
			&&  pGame->pBg->get_kabetype(m_pObj->pos.x/100-1*1,m_pObj->pos.y/100-8*2) == 0	)

			{
				//壁がなければジャンプさせる
				ChangeMoveType( enMoveTypeClimb );
				//SetJump();
			}
			
		}
	}
	else if( m_sTargetPosition > m_sPositionX )		//-800
	{
		m_sMoveX = +4;
		m_sDir = DIR_RIGHT;
		if( IsStopped() && IsLanding() )
		{
//			if( pGame->pBg->get_kabetype(m_pObj->pos.x/100+8*1,m_pObj->pos.y/100-16) == 0
//				&&  viiSub::IsGroundBlock(m_pObj->pos.x/100+8*1,m_pObj->pos.y/100) )
			if( pGame->pBg->get_kabetype(m_pObj->pos.x/100+1*1,m_pObj->pos.y/100-8*0) == 1
			&&  pGame->pBg->get_kabetype(m_pObj->pos.x/100+1*1,m_pObj->pos.y/100-8*1) == 1
			&&  pGame->pBg->get_kabetype(m_pObj->pos.x/100+1*1,m_pObj->pos.y/100-8*2) == 0)
			{
				//壁がなければジャンプさせる
				ChangeMoveType( enMoveTypeClimb );
//				SetJump();
			}
			
		}
	}
	else
	{
		m_sMoveX = 0;
		if( MoveSpeedDecrement() )
		{
			ChangeMoveType( enMoveTypeWait );
		}
	}
}
开发者ID:programmerMOT,项目名称:gunhound,代码行数:51,代码来源:CSoldierBase.cpp


示例4: while

void WINAPI CTNTServer::OnReceive(const CONNECTION_ID&	Connection, 
									   const LPVOID			pData,
									   const DWORD			dwDataLen)
{
	CFixBuffer&	InputStream = m_mapPeers[Connection.m_Socket].m_InputStream;

	InputStream.Put(pData, dwDataLen);

	while(true)
	{
		// is there a room for MsgSize?
		if(InputStream.GetLength() < MESSAGE_HEADER_SIZE)
			return;

		CString strSize;
		char* pSizeString = strSize.GetBufferSetLength(4);
		memcpy(pSizeString,((char*)InputStream.GetData() + sizeof(char)*25),3);
		pSizeString[3]=0;
		strSize.ReleaseBuffer();
		DWORD dwSize = (DWORD)atol(strSize);

		// is there a room for Msg?
		if(InputStream.GetLength() < dwSize)
			return;

		for(COMMANDS_TYPE::iterator index = m_ValidIncomingCommands.begin(); index != m_ValidIncomingCommands.end(); index++)
		{
			CMMHHMessage* pitem= *index;
			if(pitem->Parse(InputStream) == ERROR_SUCCESS)
			{
				CMessageItem	Item;
				if(IsStopped())
					break;
				Item.m_pMessage = pitem->GetNewCopy();
				TMapPeers::iterator it = m_mapPeers.find(Connection.m_Socket);
				if(it == m_mapPeers.end())
				{
					ATLASSERT(false);
					return;
				}

				Item.m_Client = it->first;
				m_queIncoming.Push(Item);
				break;
			}
		}
		if(IsStopped())
			return;
	}
}
开发者ID:AlexS2172,项目名称:IVRMstandard,代码行数:50,代码来源:TNTServer.cpp


示例5: while

void ChildWatchDog::Run()
{
	static const int WAIT_SECONDS = 60;
	time_t start = Util::CurrentTime();
	while (!IsStopped() && (Util::CurrentTime() - start) < WAIT_SECONDS)
	{
		Util::Sleep(10);
	}

	if (!IsStopped())
	{
		info("Restarting hanging child process for %s", *m_infoName);
		kill(m_processId, SIGKILL);
	}
}
开发者ID:nzbget,项目名称:nzbget,代码行数:15,代码来源:Script.cpp


示例6: time

void ChildWatchDog::Run()
{
	static const int WAIT_SECONDS = 60;
	time_t tStart = time(NULL);
	while (!IsStopped() && (time(NULL) - tStart) < WAIT_SECONDS)
	{
		usleep(10 * 1000);
	}

	if (!IsStopped())
	{
		info("Restarting hanging child process");
		kill(m_hProcessID, SIGKILL);
	}
}
开发者ID:ta264,项目名称:nzbget_svn,代码行数:15,代码来源:Script.cpp


示例7: debug

void UrlCoordinator::Run()
{
	debug("Entering UrlCoordinator-loop");

	while (!DownloadQueue::IsLoaded())
	{
		usleep(20 * 1000);
	}

	int resetCounter = 0;

	while (!IsStopped())
	{
		bool downloadStarted = false;
		if (!g_Options->GetPauseDownload() || g_Options->GetUrlForce())
		{
			// start download for next URL
			GuardedDownloadQueue downloadQueue = DownloadQueue::Guard();
			if ((int)m_activeDownloads.size() < g_Options->GetUrlConnections())
			{
				NzbInfo* nzbInfo = GetNextUrl(downloadQueue);
				bool hasMoreUrls = nzbInfo != nullptr;
				bool urlDownloadsRunning = !m_activeDownloads.empty();
				m_hasMoreJobs = hasMoreUrls || urlDownloadsRunning;
				if (hasMoreUrls && !IsStopped())
				{
					StartUrlDownload(nzbInfo);
					downloadStarted = true;
				}
			}
		}

		int sleepInterval = downloadStarted ? 0 : 100;
		usleep(sleepInterval * 1000);

		resetCounter += sleepInterval;
		if (resetCounter >= 1000)
		{
			// this code should not be called too often, once per second is OK
			ResetHangingDownloads();
			resetCounter = 0;
		}
	}

	WaitJobs();

	debug("Exiting UrlCoordinator-loop");
}
开发者ID:sanderjo,项目名称:nzbget,代码行数:48,代码来源:UrlCoordinator.cpp


示例8: ISetFault

uint32_t plLayerMovie::Eval(double wSecs, uint32_t frame, uint32_t ignore)
{
    uint32_t dirty = plLayerAnimation::Eval(wSecs, frame, ignore);

    if( !IGetFault() && !(ignore & kTexture) )
    {
        if( ICurrentFrameDirty(wSecs) )
        {           
            if( IGetCurrentFrame() )
                ISetFault("Getting current frame");

            if( GetTexture() )
            {
                hsGDeviceRef* ref = GetTexture()->GetDeviceRef();
                if( ref )
                    ref->SetDirty(true);
            }
        }
        else
        if( IsStopped() )
        {
            IMovieIsIdle();
        }
        
        dirty |= kTexture;
    }
    return dirty;
}
开发者ID:branan,项目名称:Plasma-nobink,代码行数:28,代码来源:plLayerMovie.cpp


示例9: while

void TestCommonData::Wait( bool& work, bool& done)
{
    work = false;
    done = false;
    bool started = false;
    while( !done || !started )
    {
        if (work)
            started = true;
        UpdateData();
        if ( IsStopped() )
        {            
            mCommand.Start_Oper = false;
            mCommand.Stop_Oper = true;
            mCommand.Nasos_M2 = app::Settings::Instance().MainPupm() == "M2";
            mCommand.OP15_25_Continum = false;
            mCommand.Next_Amp = false;
            mCommand.Write();
            Log( "Испытание прервано" );
            return;
        }
    }
    TestingTime = StartTime.elapsed()/1000;    
    *mStopMarker = !CheckErrors();
}
开发者ID:firef0xff,项目名称:SSHGS01,代码行数:25,代码来源:test_base.cpp


示例10: debug

void ServiceCoordinator::Run()
{
	debug("Entering ServiceCoordinator-loop");

	const int iStepMSec = 100;
	int iCurTick = 0;

	while (!IsStopped())
	{
		for (ServiceList::iterator it = m_Services.begin(); it != m_Services.end(); it++)
		{
			Service* pService = *it;
			if (iCurTick >= pService->m_iLastTick + pService->ServiceInterval() ||	// interval expired
				iCurTick == 0 ||													// first start
				iCurTick + 10000 < pService->m_iLastTick)							// int overflow
			{
				pService->ServiceWork();
				pService->m_iLastTick = iCurTick;
			}
		}

		iCurTick += iStepMSec;
		usleep(iStepMSec * 1000);
	}

	debug("Exiting ServiceCoordinator-loop");
}
开发者ID:0BruceWayne0,项目名称:nzbget,代码行数:27,代码来源:Service.cpp


示例11: debug

void PrePostProcessor::Run()
{
	debug("Entering PrePostProcessor-loop");

	while (!DownloadQueue::IsLoaded())
	{
		usleep(20 * 1000);
	}

	if (g_Options->GetServerMode() && g_Options->GetSaveQueue() && g_Options->GetReloadQueue())
	{
		SanitisePostQueue();
	}

	while (!IsStopped())
	{
		if (!g_Options->GetTempPausePostprocess())
		{
			// check post-queue every 200 msec
			CheckPostQueue();
		}

		Util::SetStandByMode(!m_curJob);

		usleep(200 * 1000);
	}

	debug("Exiting PrePostProcessor-loop");
}
开发者ID:outtahere,项目名称:nzbget,代码行数:29,代码来源:PrePostProcessor.cpp


示例12: SaveRespawnTime

void Creature::setDeathState(DeathState s)
{
    if(s == JUST_DIED)
    {
        m_deathTimer = m_corpseDelay*1000;

        // always save boss respawn time at death to prevent crash cheating
        if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY) || isWorldBoss())
            SaveRespawnTime();

        if(!IsStopped()) StopMoving();
    }
    Unit::setDeathState(s);

    if(s == JUST_DIED)
    {
        SetUInt32Value(UNIT_NPC_FLAGS, 0);
        if(!isPet() && GetCreatureInfo()->SkinLootId)
        {
            LootStore skinStore = LootTemplates_Skinning;
            LootStore::iterator tab = skinStore.find(GetCreatureInfo()->SkinLootId);
            if ( tab != skinStore.end() )
                SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
        }
        Unit::setDeathState(CORPSE);
    }
}
开发者ID:chrayn,项目名称:mangos-06,代码行数:27,代码来源:Creature.cpp


示例13: debug

void ServiceCoordinator::Run()
{
	debug("Entering ServiceCoordinator-loop");

	const int stepMSec = 100;
	int curTick = 0;

	while (!IsStopped())
	{
		for (Service* service : m_services)
		{
			if (curTick >= service->m_lastTick + service->ServiceInterval() ||	// interval expired
				curTick == 0 ||													// first start
				curTick + 10000 < service->m_lastTick)							// int overflow
			{
				service->ServiceWork();
				service->m_lastTick = curTick;
			}
		}

		curTick += stepMSec;
		usleep(stepMSec * 1000);
	}

	debug("Exiting ServiceCoordinator-loop");
}
开发者ID:outtahere,项目名称:nzbget,代码行数:26,代码来源:Service.cpp


示例14: debug

void PrePostProcessor::Run()
{
	debug("Entering PrePostProcessor-loop");

	while (!DownloadQueue::IsLoaded())
	{
		usleep(20 * 1000);
	}

	if (g_Options->GetServerMode())
	{
		SanitisePostQueue();
	}

	while (!IsStopped())
	{
		if (!g_Options->GetTempPausePostprocess() && m_queuedJobs)
		{
			// check post-queue every 200 msec
			CheckPostQueue();
		}

		usleep(200 * 1000);
	}

	WaitJobs();

	debug("Exiting PrePostProcessor-loop");
}
开发者ID:sanderjo,项目名称:nzbget,代码行数:29,代码来源:PrePostProcessor.cpp


示例15: StopGas

void Train::Update(const sf::Input &input) {
    
        static sf::Clock clock;
        static bool waiting = false;

        acceleration = (1/mass) *(push_force - speed * brakes_factor);
        speed += acceleration;
        position.z += speed;

        if (position.z > 900 || position.z < -900) {
            position.z = -position.z;
            //comingSound.SetPosition(this->position);
            comingSound.Play();
            StopGas();
        }
    if (!user_controlled){
        if (position.z < -250 && position.z > -300){
            StopGas();
            Brakes();
        }
        if (IsStopped() && !waiting){
            clock.Reset();
            alarm=false;
            waiting = true;
            printf("\n\n\n                         waiting\n");        

        }
        if (waiting && clock.GetElapsedTime() > waiting_time) {
            Gas();        
            waiting = false;        
            printf("                         timed out\n");
        }
        if (waiting && clock.GetElapsedTime() > waiting_time-4 && !alarm) {
            alarm=true;
                sound.SetBuffer(Buffer);             
                //sound.SetPitch(0.6);
                //sound.SetAttenuation(0.4);
                sound.SetRelativeToListener(true);
                sound.SetPosition(this->position);
                sound.SetMinDistance(100);
                sound.Play();
                //movmetnSound.SetPosition(this->position);
                movmetnSound.Play();
        }


        light->position = sf::Vector3f(-40.900002,10,position.z + 5) ;

        if(camera !=NULL)
            camera->SetOrigin(position.x+8.3,position.y+15,position.z);
    }else {
        if (input.IsKeyDown(sf::Key::Z)) {
            push_force = 0.1f;
        }else if (input.IsKeyDown(sf::Key::X)){
            brakes_factor = 0.05f;
        }
        
    }

}
开发者ID:IdeasStorm,项目名称:QuickSFML,代码行数:60,代码来源:Train.cpp


示例16: count

int CScionCamera::SequenceThread::svc()
{
long count(0);

// capture requested number of images
while (!IsStopped() && count < numImages_)
{
	// get next image
	int ret = camera_->SnapImage();
	if (ret != DEVICE_OK)
   {
      camera_->sequenceRunning_ = false;
      camera_->OnThreadExiting();
		return(1);
   }

	// got image - insert image in micro manager buffer pool
	ret = camera_->InsertImage();
	if (ret != DEVICE_OK)
   {
      camera_->sequenceRunning_ = false;
      camera_->OnThreadExiting();
		return(1);
   }

	camera_->image_counter_++;
	count++;
}

// sequence complete
camera_->OnThreadExiting();
camera_->sequenceRunning_ = false;

return(0);
}
开发者ID:bwagjor,项目名称:Thesis,代码行数:35,代码来源:capture.cpp


示例17: ASSERT

// provides derived filter a chance to release it's extra interfaces
HRESULT CParserOutputPin::BreakConnect() 
{
    //  Can't disconnect unless stopped
    ASSERT(IsStopped());
    m_pTransformFilter->BreakConnect(PINDIR_OUTPUT);
    return CBaseOutputPin::BreakConnect();
}
开发者ID:guojerry,项目名称:cppxml,代码行数:8,代码来源:Parser.cpp


示例18: dir

void ParRenamer::CheckFiles(const char* destDir, bool checkPars)
{
	DirBrowser dir(destDir);
	while (const char* filename = dir.Next())
	{
		if (!IsStopped())
		{
			BString<1024> fullFilename("%s%c%s", destDir, PATH_SEPARATOR, filename);

			if (!FileSystem::DirectoryExists(fullFilename))
			{
				m_progressLabel.Format("Checking file %s", filename);
				m_stageProgress = m_fileCount > 0 ? m_curFile * 1000 / m_fileCount / 2 : 1000;
				UpdateProgress();
				m_curFile++;

				if (checkPars)
				{
					CheckParFile(destDir, fullFilename);
				}
				else
				{
					CheckRegularFile(destDir, fullFilename);
				}
			}
		}
	}
}
开发者ID:nzbget,项目名称:nzbget,代码行数:28,代码来源:ParRenamer.cpp


示例19: ASSERT

HRESULT
CTransformInputPin::BreakConnect() {
    //  Can't disconnect unless stopped
    ASSERT(IsStopped());
    m_pTransformFilter->BreakConnect(PINDIR_INPUT);
    return CBaseInputPin::BreakConnect();
}
开发者ID:Ancaro,项目名称:stepmania,代码行数:7,代码来源:transfrm.cpp


示例20: ASSERT

HRESULT CAMROutputPin::BreakConnect()
{
	ASSERT(IsStopped());
	demux->BreakConnect(PINDIR_OUTPUT, this);
	discontinuity = true;
	return CBaseOutputPin::BreakConnect();
}
开发者ID:avdbg,项目名称:MPC-BE,代码行数:7,代码来源:AMRSplitter.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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