当前位置: 首页>>代码示例>>C++>>正文


C++ RemoveTimer函数代码示例

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


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

示例1: RemoveTimer

void AVL_tree::RemoveTimer(Node node, const byte& timerid){
  if(node == NULL){
    return;
  }
  if(node->timerid == timerid){
    node->timerid = 255;
  }
  RemoveTimer(node->left, timerid);
  RemoveTimer(node->right, timerid);
}
开发者ID:idittansikte,项目名称:ArduinoSmartHome,代码行数:10,代码来源:AVL_tree.cpp

示例2: LOG

void TMasterClient::Die() {
  LOG(INFO) << "Tmaster client is being destroyed " << std::endl;
  to_die_ = true;
  Stop();
  // Unregister the timers
  if (reconnect_timer_id > 0) {
    RemoveTimer(reconnect_timer_id);
  }

  if (heartbeat_timer_id > 0) {
    RemoveTimer(heartbeat_timer_id);
  }
}
开发者ID:10fish,项目名称:heron,代码行数:13,代码来源:tmaster-client.cpp

示例3: DestroyTimersForWindow

BOOL FASTCALL
DestroyTimersForWindow(PTHREADINFO pti, PWND Window)
{
   PLIST_ENTRY pLE;
   PTIMER pTmr;
   BOOL TimersRemoved = FALSE;

   if ((Window == NULL))
      return FALSE;

   TimerEnterExclusive();
   pLE = TimersListHead.Flink;
   while(pLE != &TimersListHead)
   {
      pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
      pLE = pLE->Flink; /* get next timer list entry before current timer is removed */
      if ((pTmr) && (pTmr->pti == pti) && (pTmr->pWnd == Window))
      {
         TimersRemoved = RemoveTimer(pTmr);
      }
   }

   TimerLeave();

   return TimersRemoved;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:26,代码来源:timer.c

示例4: LOGF_DEBUG

bool ATIKCCD::Disconnect()
{
    ImageState  tState;
    LOGF_DEBUG("Closing %s...", name);

    stopTimerNS();
    stopTimerWE();
    RemoveTimer(genTimerID);
    genTimerID = -1;

    pthread_mutex_lock(&condMutex);
    tState = threadState;
    threadRequest = StateTerminate;
    pthread_cond_signal(&cv);
    pthread_mutex_unlock(&condMutex);
    pthread_join(imagingThread, nullptr);
    tState = StateNone;
    if (isSimulation() == false)
    {
        if (tState == StateExposure)
            ArtemisStopExposure(hCam);
        ArtemisDisconnect(hCam);
    }

    LOG_INFO("Camera is offline.");

    return true;
}
开发者ID:azwing,项目名称:indi,代码行数:28,代码来源:atik_ccd.cpp

示例5: RemoveTimer

IPState GPUSB::GuideSouth(float ms)
{
    RemoveTimer(NStimerID);

    driver->startPulse(GPUSB_SOUTH);

    DEBUG(INDI::Logger::DBG_DEBUG, "Starting SOUTH guide");

    NSDir = GPUSB_SOUTH;

    if (ms <= POLLMS)
    {
        usleep(ms * 1000);

        driver->stopPulse(GPUSB_SOUTH);
        return IPS_OK;
    }

    NSPulseRequest = ms / 1000.0;
    gettimeofday(&NSPulseStart, nullptr);
    InNSPulse = true;

    NStimerID = SetTimer(ms - 50);

    return IPS_BUSY;
}
开发者ID:rrogge,项目名称:indi,代码行数:26,代码来源:gpusb.cpp

示例6: addSummon

	void addSummon()
	{
		for(uint32 i = 0; i < 5; ++i)
			SpawnCreature( KELESETH_SKELETON_ADD, 163.376f + i + 4, 252.901f - i + 5, 42.868f, 0, true);

		RemoveTimer(mSkeletonTimer);
	};
开发者ID:arcticdev,项目名称:arctic-test,代码行数:7,代码来源:Instance_UtgardeKeep.cpp

示例7: RemoveTimer

//-----------------------------------------------------------------------------
// Purpose: Check & fire any timers that should fire based on their duration.
//-----------------------------------------------------------------------------
void CHintMessageTimers::Update()
{
	if ( !m_pHintSystem )
		return;

	for ( int i = 0; i < m_Timers.Count(); i++ )
	{
		if ( m_Timers[i]->timer.Expired() )
		{
			if ( m_pHintSystem->TimerShouldFire( m_Timers[i]->iHintID ) )
			{
				//Warning("TIMER FIRED: %s\n", m_pszHintMessages[m_Timers[i]->iHintID] );

				m_pHintSystem->HintMessage( m_Timers[i]->iHintID );

				// Remove and return. No reason to bring up multiple hints.
				RemoveTimer( m_Timers[i]->iHintID );
				return;
			}
			else
			{
				// Push the timer out again
				m_Timers[i]->timer.Start();
			}
		}
	}
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:30,代码来源:hintmessage.cpp

示例8: RemoveTimer

//============================================================================
//		NTimer::~NTimer : Destructor.
//----------------------------------------------------------------------------
NTimer::~NTimer(void)
{


	// Clean up
	RemoveTimer();
}
开发者ID:refnum,项目名称:nano,代码行数:10,代码来源:NTimer.cpp

示例9: IUUpdateNumber

bool INDI::GPS::ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n)
{
    if (dev != nullptr && strcmp(dev, getDeviceName()) == 0)
    {
        if (strcmp(name, PeriodNP.name) == 0)
        {
            double prevPeriod = PeriodN[0].value;
            IUUpdateNumber(&PeriodNP, values, names, n);
            // Do not remove timer if GPS update is still in progress
            if (timerID > 0 && RefreshSP.s != IPS_BUSY)
            {
                RemoveTimer(timerID);
                timerID = -1;
            }

            if (PeriodN[0].value == 0)
            {
                DEBUG(INDI::Logger::DBG_SESSION, "GPS Update Timer disabled.");
            }
            else
            {
                timerID = SetTimer(PeriodN[0].value*1000);
                if (prevPeriod == 0)
                    DEBUG(INDI::Logger::DBG_SESSION, "GPS Update Timer enabled.");
            }

            PeriodNP.s = IPS_OK;
            IDSetNumber(&PeriodNP, nullptr);

            return true;
        }
    }

    return DefaultDevice::ISNewNumber(dev, name, values, names, n);
}
开发者ID:rumengb,项目名称:indi,代码行数:35,代码来源:indigps.cpp

示例10: assert

void CLuaTimerManager::DoPulse ( CLuaMain* pLuaMain )
{
    assert ( m_ProcessQueue.empty () );
    assert ( !m_pPendingDelete );
    assert ( !m_pProcessingTimer );

    CTickCount llCurrentTime = CTickCount::Now ();

    // Use a separate queue to avoid trouble
    // What kind of problems are we trying to avoid? Doing a copy each frame isn't quite efficient
    for ( CFastList < CLuaTimer* > ::const_iterator iter = m_TimerList.begin () ; iter != m_TimerList.end () ; ++iter )
        m_ProcessQueue.push_back ( *iter );

    while ( !m_ProcessQueue.empty () )
    {
        m_pProcessingTimer = m_ProcessQueue.front ();
        m_ProcessQueue.pop_front ();

        CTickCount llStartTime = m_pProcessingTimer->GetStartTime ();
        CTickCount llDelay = m_pProcessingTimer->GetDelay ();
        unsigned int uiRepeats = m_pProcessingTimer->GetRepeats ();

        // Is the time up and is not being deleted
        if ( llCurrentTime >= ( llStartTime + llDelay ) )
        {
            // Set our debug info
            g_pGame->GetScriptDebugging()->SaveLuaDebugInfo ( m_pProcessingTimer->GetLuaDebugInfo ( ) );
            
            m_pProcessingTimer->ExecuteTimer ( pLuaMain );
            // Reset
            g_pGame->GetScriptDebugging()->SaveLuaDebugInfo ( SLuaDebugInfo() );

            // If this is the last repeat, remove
            if ( uiRepeats == 1 )
            {
                RemoveTimer ( m_pProcessingTimer );
            }
            else
            {
                // Decrease repeats if not infinite
                if ( uiRepeats != 0 )
                    m_pProcessingTimer->SetRepeats ( uiRepeats - 1 );

                m_pProcessingTimer->SetStartTime ( llCurrentTime );
            }
        }

        // Finally cleanup timer if it was removed during processing
        if ( m_pPendingDelete )
        {
            assert ( m_pPendingDelete == m_pProcessingTimer );
            m_pProcessingTimer = NULL;
            delete m_pPendingDelete;
            m_pPendingDelete = NULL;
        }
        else
            m_pProcessingTimer = NULL;
    }
}
开发者ID:AdiBoy,项目名称:mtasa-blue,代码行数:59,代码来源:CLuaTimerManager.cpp

示例11: Death

func Death()
{
	RemoveTimer(this.UpdateSwim);
	RemoveTimer(this.Activity);
	this.MeshTransformation = Trans_Rotate(160 + Random(41), 1, 0, 0);
	if (base_transform) this.MeshTransformation = Trans_Mul(base_transform, this.MeshTransformation);
	StopAnimation(swim_animation);
	AddTimer(this.Decaying, 500);
	this.Collectible = true;
	
	// maybe respawn a new fish if roe is near
	var roe = FindObject(Find_Distance(200), Find_ID(FishRoe));
	if (roe)
		roe->Hatch(GetID());
	
	return _inherited(...);
}
开发者ID:sarah-russell12,项目名称:openclonk,代码行数:17,代码来源:Script.c

示例12: CastSpell

void MoonScriptBossAI::AIUpdate(MapManagerScript* MMSCript, uint32 p_time)
{
	if( mEnrageSpell && mEnrageTimerDuration > 0 && IsTimerFinished(mEnrageTimer) )
	{
		CastSpell(mEnrageSpell);
		RemoveTimer(mEnrageTimer);
	}
	MoonScriptCreatureAI::AIUpdate(MMSCript, p_time);
}
开发者ID:Refuge89,项目名称:Hearthstone,代码行数:9,代码来源:Base.cpp

示例13: CastSpell

void ArcScriptBossAI::AIUpdate()
{
	if( mEnrageSpell && mEnrageTimerDuration > 0 && IsTimerFinished(mEnrageTimer) )
	{
		CastSpell(mEnrageSpell);
		RemoveTimer(mEnrageTimer);
	}
	ArcScriptCreatureAI::AIUpdate();
}
开发者ID:AegisEmu,项目名称:AegisEmu,代码行数:9,代码来源:Base.cpp

示例14: AIUpdate

        void AIUpdate()
        {
            if (IsTimerFinished(mReplyTimer) && pDalronn != NULL)
            {
                pDalronn->Emote("By all means, don't assess the situation, you halfwit! Just jump into the fray!", Text_Yell, 13199);
                RemoveTimer(mReplyTimer);
            };

            ParentClass::AIUpdate();
        };
开发者ID:Declipe,项目名称:AscEmu,代码行数:10,代码来源:Instance_UtgardeKeep.cpp

示例15: ResetTimer

bool ResetTimer(std::shared_ptr<TimerEvent> te, int milliSecs /* = 0 */)
{
	RemoveTimer(te);
	if (milliSecs > 0)
	{
		te->m_timeval.tv_sec = milliSecs / 1000;
		te->m_timeval.tv_usec = (milliSecs % 1000) * 1000;
	}
	return AddTimer(te);
}
开发者ID:angel0sl,项目名称:FServer,代码行数:10,代码来源:TimerEvent.cpp


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