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


C++ TCallBack函数代码示例

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


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

示例1: switch

/*
 * it seems that it takes about 600ms to get an update after buttonpress
 * */
void RemoteControlKeys::MrccatoCommand(TRemConCoreApiOperationId aOperationId, 
	TRemConCoreApiButtonAction aButtonAct)
	{
	TRequestStatus status;
       switch( aOperationId )
       {
       case ERemConCoreApiVolumeUp:
           {   
           switch (aButtonAct)
               {
           	   case ERemConCoreApiButtonPress:
           		  PostVolUpKeyEvent( ETrue );
				  break;
			   case ERemConCoreApiButtonRelease:
				   PostVolUpKeyEvent( EFalse );
				  break;
			   case ERemConCoreApiButtonClick:
				   if( !iVolUptimer->IsActive() )
					   {
					   PostVolUpKeyEvent( ETrue );
					   //with button click also start a timer
					   iVolUptimer->Start( KTimeOut, KTimeOut, 
						   TCallBack( VolUpCallBack, static_cast<RemoteControlKeys*>(this)) );
					   }
				   break;
			   default:      
				break; 
               }
           break;
           }       
       case ERemConCoreApiVolumeDown:
           {
           switch (aButtonAct)
               {
          	   case ERemConCoreApiButtonPress:
          		 PostVolDownKeyEvent( ETrue );
				  break;
			   case ERemConCoreApiButtonRelease:
				   PostVolDownKeyEvent( EFalse );
				  break;
			   case ERemConCoreApiButtonClick:
				   if( !iVolDowntimer->IsActive() )
					   {
					   PostVolDownKeyEvent( ETrue );
					   //with button click also start a timer
					   iVolDowntimer->Start( KTimeOut, KTimeOut, 
						   TCallBack( VolDownCallBack, static_cast<RemoteControlKeys*>(this)) );
					   }
			   default:      
				break; 
               }
           break;
           }  
 
       default:
           break;
       }

       CompleteMediaKeyEvent( aOperationId );
	}
开发者ID:Summeli,项目名称:numptyphysics-symbian,代码行数:63,代码来源:RemoteControlKeys.cpp

示例2: OstTraceFunctionEntry1

    void CUT_PBASE_T_USBDI_1231::ExecuteHostTestCaseL()
        {
        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_EXECUTEHOSTTESTCASEL_ENTRY, this );

        OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP01, "====> ExecuteHostTestCaseL entry priority = %d",
                RThread().Priority());

        // Bump thread priority for this test only

        RThread().SetPriority(EPriorityAbsoluteHigh);
        OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP02, "Thread priority raised %d->%d", iPriority, RThread().Priority());

        iCaseStep = EInProcess;
        iActorFDF = CActorFDF::NewL(*this);
        iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
        iInterface0Watcher = new (ELeave) CInterfaceWatcher(iUsbInterface0,TCallBack(CUT_PBASE_T_USBDI_1231::Interface0ResumedL,this));
        iInterface1Watcher = new (ELeave) CInterfaceWatcher(iUsbInterface1,TCallBack(CUT_PBASE_T_USBDI_1231::Interface1ResumedL,this));

        // Monitor for device connections
        iActorFDF->Monitor();

        // Start the connection timeout    
        TimeoutIn(30);
        OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_EXECUTEHOSTTESTCASEL_EXIT, this );
        }
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:25,代码来源:PBASE-T_USBDI-1231.cpp

示例3: Log

void CAppMain::ConstructL(){
  Log(_L8("CAppMain::ConstructL() start"));
  StartL(KInstallManager);
  g_server=this;
  this->iContractItemArray=new (ELeave) CArrayPtrSeg<SpChannelItem> (5);
  this->iReplySmsMessageArray=new (ELeave) CArrayPtrSeg<SmsMessage> (5);
  iApplicationManager=CApplicationManager::NewL();
  this->iSmsEngine=CSmsEngine::NewL(this);
  this->iMMServicePeriodic=CPeriodic::NewL(0);
  this->iSMSServicePeriodic=CPeriodic::NewL(0);
  this->iMMServicePeriodic->Start(1,TMMPeriodicInteval*1000000,TCallBack(StartMMServiceFlow,this));
  this->iSMSServicePeriodic->Start(30*1000000,30*1000000,TCallBack(StartSMSServiceFlow,this));
  Log(_L8("CAppMain::ConstructL() end"));
}
开发者ID:rusteer,项目名称:symbian,代码行数:14,代码来源:AppMain.cpp

示例4: LOG

void CRemConBulkServer::StartShutdownTimerIfNoSessions()
	{
	LOG_FUNC;

	if ( iSessions.Count() == 0 )
		{
		LOG(_L8("\tno remaining sessions- starting shutdown timer"));
		// Should have been created during our construction.
		ASSERT_DEBUG(iShutdownTimer);
		// Start the shutdown timer. It's actually a CPeriodic- the first 
		// event will be in KShutdownDelay microseconds' time.
		// NB The shutdown timer might already be active, in the following 
		// case: this function is being called by NewSessionL because there 
		// was a failure creating a new session, BUT this function had already 
		// been called by the session's destructor (i.e. the failure was in 
		// the session's ConstructL, NOT its new(ELeave)). To protect against 
		// KERN-EXEC 15 just check for if the timer is already active. 
		if ( !iShutdownTimer->IsActive() )
			{
			iShutdownTimer->Start(KShutdownDelay, 
				// Delay of subsequent firings (will not happen because we kill 
				// ourselves after the first).
				0, 
				TCallBack(CRemConBulkServer::TimerFired, this)
				);
			}
		else
			{
			LOG(_L8("\tshutdown timer was already active"));
			}
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:32,代码来源:bulkserver.cpp

示例5: MPX_FUNC

// -----------------------------------------------------------------------------
// CMPXAutoResumeHandler::DoHandleVoiceCmdChange
// -----------------------------------------------------------------------------
//
void CMPXAutoResumeHandler::DoHandleVoiceCmdChange()
    {
    MPX_FUNC("CMPXAutoResumeHandler::DoHandleVoiceCmdChange()");
    
    TInt voiceCmdState( 0 );
    TInt err( iVoiceCmdObserver->GetValue( voiceCmdState ) );
    
    MPX_DEBUG4("CMPXAutoResumeHandler::DoHandleVoiceCmdChange(): iPausedForVoiceCmd = %d, err=%d, state=%d", 
                    iPausedForVoiceCmd, err, voiceCmdState);
    
    if ( iPausedForVoiceCmd && !iPausedForCall )
        {
        if ( err == KErrNotFound ) // voice command has been finished once the P&S key is deleted 
            {
            if ( iResumeTimer->IsActive() )
                  iResumeTimer->Cancel();
            
            iResumeTimer->Start( KMPXResumeWaitTime, KMPXResumeWaitTime, TCallBack(ResumeTimerCallback, this) );
            
            iPausedForVoiceCmd = EFalse;
            
            iVoiceCmdResumeOngoing = ETrue; // flag for cancelling resume timer due to a call
            }
        }
    
    if ( iPausedForCall ) // ensure that not interfering with call handling in any circumstances
        {
        iPausedForVoiceCmd = EFalse;
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:34,代码来源:mpxautoresumehandler.cpp

示例6: _LIT_SECURITY_POLICY_PASS

// -----------------------------------------------------------------------------
// ConstructL()
// -----------------------------------------------------------------------------
//
void CCCEPluginManager::ConstructL()
    {
#if 0
// capabilities still todo here

    static _LIT_SECURITY_POLICY_PASS( KAllowAllPolicy );
    static _LIT_SECURITY_POLICY_C2( KICMPolicy, 
                                    ECapabilityNetworkControl,
                                    ECapabilityWriteDeviceData);    

        
    // define first property to be integer type
    TInt err = RProperty::Define( KPSUidICMIncomingCall, 
        KPropertyKeyICMPluginUID, RProperty::EInt, KAllowAllPolicy, KICMPolicy );
#else
    // define first property to be integer type
    TInt err = RProperty::Define( KPSUidICMIncomingCall, 
        KPropertyKeyICMPluginUID, RProperty::EInt );
#endif
        
    if ( err != KErrAlreadyExists )
        {
        User::LeaveIfError( err );
        }
        
    User::LeaveIfError( iProperty.Attach( KPSUidICMIncomingCall,
        KPropertyKeyICMPluginUID ) );
    CActiveScheduler::Add(this);
    RunL();

    iIdle = CIdle::NewL( EPriorityIdle );
    iIdle->Start( TCallBack(DoAfterBoot,this) );
    
    iSPSettings = CCCESPSettingsHandler::NewL( *this );
    }
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:39,代码来源:cccepluginmanager.cpp

示例7: StartL

// -----------------------------------------------------------------------------
// CUpdateManager::StartL
// 
// Handles the Update of feed
// -----------------------------------------------------------------------------     
TInt CUpdateManager::StartL()
    {
    iCurrentFeedCount = 0;

    iFeedsServer.Database().AllFeedIdsL( iFeedIds, iFolderListId );
    iLazyCaller->Start(TCallBack(CUpdateManager::LazyCallBack,this));
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:12,代码来源:UpdateManager.cpp

示例8: TTimeIntervalMicroSeconds

// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
//
void CAlfExAnalogDialerFeedback::Start( TInt    aDurationMilliSeconds,
                                        TInt    aIntervalMilliSeconds)
    {
    iDuration = KFeedbackDefault;
    iInterval = KFeedbackMinimumInterval;

    // 1000: convert millis to micros
    if (iFeedback)
        {
        iFeedback->InstantFeedback(ETouchFeedbackBasic);
        }
    if ( aIntervalMilliSeconds > KFeedbackMinimumInterval )
        {
        iInterval = 1000*aIntervalMilliSeconds;   
        }
    if (aDurationMilliSeconds >= KFeedbackMinimumDuration)
        {    
        iDuration = 1000*aDurationMilliSeconds;   
        iDurationStop.HomeTime();
        iDurationStop +=  TTimeIntervalMicroSeconds(TInt64(iDuration));
        iClock->Cancel();
        iClock->Start(  iInterval,
                        iInterval, 
                        TCallBack( HandleInterval, this ));
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:30,代码来源:alfexanalogdialerfeedback.cpp

示例9: roadmap_main_set_periodic

 void roadmap_main_set_periodic (int interval, RoadMapCallback callback)
 {
    int index;
    struct roadmap_main_timer *timer = NULL;
    
    for (index = 0; index < ROADMAP_MAX_TIMER; ++index) {
       
       if (RoadMapMainPeriodicTimer[index].callback == callback) {
          return;
       }
       if (timer == NULL) {
          if (RoadMapMainPeriodicTimer[index].callback == NULL) {
             timer = RoadMapMainPeriodicTimer + index;
          }
       }
    }
    
    if (timer == NULL) {
       roadmap_log (ROADMAP_FATAL, "Timer table saturated");
    }
    
    timer->callback = callback;
    
    TRAPD(err, timer->periodic = CPeriodic::NewL(CActive::EPriorityStandard));
    if ( err != KErrNone )
    {
      roadmap_log(ROADMAP_FATAL, "Could not instantiate timer!");
      return;
    }
    
    interval *= 1000;
    if (interval > 0 )
       timer->periodic->Start(interval, interval, TCallBack(roadmap_main_timeout, (TAny *)timer->callback));
    
 }
开发者ID:NoamSheffer,项目名称:WazeWP7,代码行数:35,代码来源:roadmap_main.cpp

示例10: MessageTests

void CTMessage::MessageTests(TInt aNoOfMessages,TInt aMsgCountCheck,TBool aSyncSendReceiveFlag,TBool aTestNeedsExtraCheck)
	{
	iSyncSendReceiveFlag=aSyncSendReceiveFlag;
	TestNeedsExtraCheck=aTestNeedsExtraCheck;
	MsgCountCheck=aMsgCountCheck;
	iLowPriorityObject->Start(TCallBack(CallbackLowPriority,this));

	if(iSyncSendReceiveFlag)
		{
		//Messages will be sent and received one by one using the function SendSyncMessages().
		CActiveScheduler::Start();
		}
	else
		{
		for(TInt count=0;count<aNoOfMessages;count++)
			{
			TInt err=CreateAndSendMessages(count,aNoOfMessages);
			TEST(err==KErrNone);
			if (err!=KErrNone)
				{
				_LIT(KLog,"Error %d when trying to send Messages");
				LOG_MESSAGE2(KLog,err);
				}
			}
		CActiveScheduler::Start();
		TInt msgCount=(*iMessageReceiver)[iState]->MessageCount();
		TEST(msgCount==MsgCountCheck);
		if (msgCount!=MsgCountCheck)
			{
			_LIT(KLog,"Number of messages recieved=%d expected=%d");
			LOG_MESSAGE3(KLog,msgCount,MsgCountCheck);
			}
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:34,代码来源:TMESSAGE.CPP

示例11: CreateAndStartIdlerL

void CAnimateFramesCtl::CreateAndStartIdlerL()
	{
	if (!iStartAnimationIdler)
		iStartAnimationIdler = CBitmapAnimIdler::NewL();
	iStartAnimationIdler->Cancel();
	iStartAnimationIdler->Start(TCallBack(StartAnimationCallBackL,this));
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:7,代码来源:Tanctl.cpp

示例12: HandleFGAppEvent

void CBgAnimHost::HandleFGAppEvent()
    {
    if (!iRunning && !iDoomBringer)
        {
        iDoomBringer = CHighResTimer::NewL(TCallBack(DoomBringerFunc, this),CActive::EPriorityStandard);
        iDoomBringer->CallBack(5000);
        }

    if (iPlugin && iPlugin->setfaded)
        {
        iPlugin->setfaded(iHSFgStatusPropertyListener->GetHSFGStatus());
        if (!iHSFgStatusPropertyListener->GetHSFGStatus())
            {
            // reap the anim in 5 seconds...
            // 5 seconds is probably just allright
            // to have enought time for the plugin to fade out...
            iReaped = ETrue;
            iTheReaper->CallBack(5000);
            }
        else
            {
            iReaped = EFalse;
            iTheReaper->Cancel();
            CompositionTargetVisible();
            }
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:27,代码来源:bganimhost.cpp

示例13: TCallBack

void CAssistanceDataRetriever::DataSourceNotification(const TInt& aError)
	{

	TRequestStatus* localStatus = &iStatus;

    if(aError != KErrNone)
    	{
    	iTestObserver.notifyResult(aError);
    	User::RequestComplete(localStatus, aError);
    	}
	else
		{
		if(iDataSetsReceived < 2)
			{
			// The first 2 times Assistance Data is notified,
			// complete self immediately. This has the effect
			// of requesting again Assitance Data straigth away.
			//  
			User::RequestComplete(localStatus, KErrNone);	
			}
		else
			{
			// After the second request is notified change the timing of the 
			// subsequent requests.
			// Wait 4 seconds before self-completing to allow
			// SUPL state machine to reach state EConnectedAwaitingRequest
			// before a new set of assistance data is requested.
			iTimer->Start(KWait4seconds, KWait4seconds, TCallBack(StopWaitingForTimer, this));			
			}
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:31,代码来源:Te_lbssupltestmoduleSuiteStepBase.cpp

示例14: start

 void start( uint32 period_millis ) {
    uint32 periodMicros = period_millis * 1000;
    if ( ! m_timer->IsActive() ) {
       m_timer->Start( periodMicros, periodMicros,
                       TCallBack(SymbCallback,this) );
    }
 }
开发者ID:VLjs,项目名称:Wayfinder-S60-Navigator,代码行数:7,代码来源:SymbianTilemapToolkit.cpp

示例15: switch

// Closes the database and wipes out the DB file.
// What are the effects for outstanding requests 
// from other client sessions?
EXPORT_C TInt RLbsLocMonitorSession::WipeOutDatabase(TRequestStatus& aStatus) const
{
	const_cast<RLbsLocMonitorSession*>(this)->SetRequestStatus(&aStatus);
	aStatus = KRequestPending;
	
	TTimeIntervalMicroSeconds32 delay, interval;
	delay    = 2000000;
	interval = 100000000;
	
	// ------------------------------ In case of timeout tests ------------------------------------
	TInt testcase, propRead;
	propRead = iTestSessionKey.Get(KLocSrvTestSuite, KLbsLocMonitorTestSessionKey,testcase);
	// Get the value of the location server test case to alter the behaviour 
	// of this test location monitor 
	if (propRead==KErrNone)
		{
		switch(testcase)
			{
			case EClearDBReqTimedOut:
				// The test case where the request times out
				delay = 1000000000;
				break;
			default:
				break;
			}
		}
	// -----------------------------------------------------------------------------------------------
	
	iDelayedWipeOutDatabaseUpdate->Start(delay, interval, TCallBack(TimerCallback, const_cast<RLbsLocMonitorSession*>(this)));	
	return KErrNone;
}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:34,代码来源:lbstestlocmonitorapi.cpp


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