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


C++ TCleanupItem函数代码示例

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


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

示例1: OpenEtelServerL

/**
@SYMTestCaseID BA-CTSY-TRCH-CSTC-0002
@SYMComponent  telephony_ctsy
@SYMTestCaseDesc Test support in CTSY for RMobileCall::SetTrafficChannel for data calls
@SYMTestPriority High
@SYMTestActions Invokes RMobileCall::SetTrafficChannel for data calls
@SYMTestExpectedResults Pass
@SYMTestType CT
*/
void CCTsyTrafficChannelFU::TestSetTrafficChannel0006L()
	{

	OpenEtelServerL(EUseExtendedError);
	CleanupStack::PushL(TCleanupItem(Cleanup,this));
	OpenPhoneL();

	TestSetTrafficChannelNotSupportedL(KMmTsyDataLineName);

	CleanupStack::PopAndDestroy(this);
	
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:21,代码来源:cctsytrafficchannelfu.cpp

示例2: OpenEtelServerL

/**
@SYMTestCaseID BA-CTSY-ALLS-MGAL-0005
@SYMComponent  telephony_ctsy
@SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetALSLine with timeout
@SYMTestPriority High
@SYMTestActions Invokes RMobilePhone::GetALSLine and tests for timeout
@SYMTestExpectedResults Pass
@SYMTestType CT
*/
void CCTsyAlternateLineServiceFU::TestGetALSLine0005L()
	{

	OpenEtelServerL(EUseExtendedError);
	CleanupStack::PushL(TCleanupItem(Cleanup,this));
	OpenPhoneL();

	RBuf8 data;
	CleanupClosePushL(data);

	TRequestStatus requestStatus;
	TInt ret(-1);

	//-------------------------------------------------------------------------
	// Test A: Test timeout of RMobilePhone::GetALSLine
 	//-------------------------------------------------------------------------

	// create centRep to change repository 
	CRepository* centRep = CRepository::NewL( KCRUidCtsyMEAlsLine );
	CleanupStack::PushL(centRep);
    
	// setting environment (set KCtsyMEAlsSupported in repository to ETrue)
	ret = centRep->Set( KCtsyMEAlsSupported, ETrue );
	ASSERT_EQUALS(KErrNone, ret);

	// setting environment (set alsLine to EAlternateLinePrimary)
	iMockLTSY.NotifyTerminated(requestStatus);
	RMobilePhone::TMobilePhoneALSLine alsLine(RMobilePhone::EAlternateLineUnknown);
	TMockLtsyData1<RMobilePhone::TMobilePhoneALSLine> alsLineData(alsLine);
	alsLineData.SerialiseL(data);
	iMockLTSY.CompleteL(EMobilePhoneGetALSLine, KErrNone, data);
	User::WaitForRequest(requestStatus);
	ASSERT_EQUALS(KErrNone, requestStatus.Int());
	AssertMockLtsyStatusL();
	
	// test setting and execute
	iMockLTSY.ExpectL(EMobilePhoneGetALSLine, KErrNone);
	ret = iPhone.GetALSLine(alsLine);
	ASSERT_EQUALS(KErrTimedOut, ret);
	ASSERT_EQUALS(alsLine, RMobilePhone::EAlternateLineNotAvailable);
	AssertMockLtsyStatusL();

	// Done !
	// return repository KCtsyMEAlsSupported to EFalse (initial state)
	ret = centRep->Set( KCtsyMEAlsSupported, EFalse );
	ASSERT_EQUALS(KErrNone, ret);

	AssertMockLtsyStatusL();
	CleanupStack::PopAndDestroy(1); // iCentRep
	CleanupStack::PopAndDestroy(2, this); // data, this

	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:61,代码来源:cctsyalternatelineservicefu.cpp

示例3: SettingsTableExistsL

/**
Returns true if settigns table exists. 
(Non-secure databases prior version 3 don't have settings table)

@param aDbName Logical database name: "main" for the main database or attached database name.
*/
TBool TSqlDbSysSettings::SettingsTableExistsL(const TDesC& aDbName)
	{
	HBufC* buf = HBufC::NewLC(sizeof(KSettingsTableCheckSql) + aDbName.Length());
	TPtr sql = buf->Des();
	sql.Format(KSettingsTableCheckSql(), &aDbName);
	sqlite3_stmt* stmtHandle = ::StmtPrepare16L(iDbHandle, sql);
	CleanupStack::PushL(TCleanupItem(&FinalizeStatementHandle, stmtHandle));
	TInt rc = ::StmtNext(stmtHandle);
	CleanupStack::PopAndDestroy();//cleanupItem (statement handle)
	CleanupStack::PopAndDestroy(buf);
	__SQLLEAVE_IF_ERROR(rc);
	return rc == KSqlAtRow;
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:19,代码来源:SqlSrvDbSysSettings.cpp

示例4: __ASSERT_ALWAYS

EXPORT_C void CMemSpyEngineOutputSink::OutputPrefixSetLC( const TDesC& aPrefix )
{
    __ASSERT_ALWAYS( aPrefix.Length() <= iPrefix->Des().MaxLength(), User::Invariant() );
    TPtr pPrefix( iPrefix->Des() );
    pPrefix.Zero();

    if  ( IsPrefixAllowed( aPrefix ) )
    {
        pPrefix.Copy( aPrefix );
    }

    CleanupStack::PushL( TCleanupItem( ClearPrefix, this ) );
}
开发者ID:kuailexs,项目名称:symbiandump-os2,代码行数:13,代码来源:MemSpyEngineOutputSink.cpp

示例5: LoadVJDeCompressorL

CVJDeCompressorIf* CPppNcpIp::LoadVJDeCompressorL(TInt aMaxVJSlots)
	{
	CVJCompFactory*		Factory=NULL;
	CVJDeCompressorIf*	VJDeCompressor;
											 
	Factory = (CVJCompFactory*)FindPppFactoryL(KVjComp, TUid::Uid(KSharedLibraryUidValue), *iVJDeCompressorCon);
	CleanupStack::PushL(TCleanupItem(CNifFactory::Cleanup, Factory));
	VJDeCompressor = Factory->NewVJDeCompressorL(aMaxVJSlots);
	CleanupStack::PopAndDestroy(); // Close extra reference on Factory

	return VJDeCompressor;

	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:13,代码来源:dummyNCPIP.CPP

示例6: OpenEtelServerL

void CCTsySessionManagementFU::AuxReferenceCountL(const TDesC &aName)
	{

	OpenEtelServerL(EUseExtendedError);
	CleanupStack::PushL(TCleanupItem(Cleanup,this));

	OpenPhoneL();

    TName lineName(aName);    
    RLine line;
    
    TInt ret  = line.Open(iPhone, lineName);
    ASSERT_EQUALS(KErrNone, ret);
    CleanupClosePushL(line);  
    
    TName name;
	RCall call;
    
    ret = OpenNewCall(line, call, lineName, name);    
    ASSERT_EQUALS(KErrNone, ret);
    CleanupClosePushL(call);    

	// test on successful completion
	TInt count = call.ReferenceCount();
    ASSERT_EQUALS(1, count);

	AssertMockLtsyStatusL();

	// test on successful completion, increasing count
	RCall call2;
	
	ret = call2.OpenExistingCall(line, name);
    ASSERT_EQUALS(KErrNone, ret);
    CleanupClosePushL(call2);  
	
	count = call.ReferenceCount();
    ASSERT_EQUALS(2, count);

	AssertMockLtsyStatusL();

	// test on successful completion, decreasing count
	CleanupStack::PopAndDestroy(1);

	count = call.ReferenceCount();
    ASSERT_EQUALS(1, count);


	AssertMockLtsyStatusL();
	CleanupStack::PopAndDestroy(3, this); 
	
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:51,代码来源:cctsysessionmanagementfu.cpp

示例7: NULL

/**
Read security policies from security policy table.

The method does not guarantee that either the security policies will be read from the 
security table and stored in aSecurityPolicy parameter or aSecurityPolicy argument 
stays unchanged in a case of failure.

@param aSecurityPolicyCon Security policies container which needs to be initializeed with 
						  the database security policies.

@leave KErrNoMemory, an out of memory condition has occurred;
	   KErrGeneral, missing or invalid data in the system tables;
                  Note that the function may also leave with some other database specific 
                  errors categorised as ESqlDbError, and other system-wide error codes.
@panic SqlDb 2 In _DEBUG mode if iDbHandle is NULL (uninitialized TSqlDbSysSettings object).
*/
void TSqlDbSysSettings::LoadSecurityPolicyL(CSqlSecurityPolicy& aSecurityPolicyCon)
	{
	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
	//Even if the version of the system settings is bigger than the current one (KSqlSystemVersion constant),
	//I think that all future modifications of the system tables shall not affect the already existing
	//fields. So it is correct to think that all information available in version 1 should be available 
	//(and accessible) in all future versions of the system settings.
	//Note: no attempt shall be made here to modify the system tables structure! There may be more than one 
	//      connection to the database being processed!
	//
	//Prepare statement handle
	sqlite3_stmt* stmtHandle = ::StmtPrepare8L(iDbHandle, KGetSecuritySql());
	CleanupStack::PushL(TCleanupItem(&FinalizeStatementHandle, stmtHandle));
	//Read the security policies
	TBool defaultPolicySet = EFalse;
	TInt dbPolicySetFlag = 0;
	TInt err;
	while((err = ::StmtNext(stmtHandle)) == KSqlAtRow)
		{
		TInt objType = KDefaultObjType - 1;
		TPtrC objName(KNullDesC);
		TInt policyType = RSqlSecurityPolicy::ESchemaPolicy - 1;
		TSecurityPolicy policy = ReadCurrSecurityPolicyL(stmtHandle, objType, objName, policyType);
		switch(objType)
			{
			case KDefaultObjType:
				if(defaultPolicySet)
					{
					__SQLLEAVE(KErrGeneral);//two "default policy" records in the table
					}
				StoreDefaultSecurityPolicy(aSecurityPolicyCon, policy, dbPolicySetFlag);
				defaultPolicySet = ETrue;
				break;
			case KDbObjType:
				StoreDbSecurityPolicyL(aSecurityPolicyCon, policyType, policy, dbPolicySetFlag);
				break;
			case RSqlSecurityPolicy::ETable:
				StoreDbObjSecurityPolicyL(aSecurityPolicyCon, objType, objName, policyType, policy);
				break;
			default:
				__SQLLEAVE(KErrGeneral);
				break;
			}//end of "switch(aObjType)"
		}
	CleanupStack::PopAndDestroy();//cleanupItem (statement handle)
	__SQLLEAVE_IF_ERROR(err);
	if(!defaultPolicySet)
		{
		__SQLLEAVE(KErrGeneral);//no default policy
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:67,代码来源:SqlSrvDbSysSettings.cpp

示例8: ReadAllGroupsL

/** Reads all groups in user defined time zone database into the specified CTzLocalizedCityGroupArray. 
Note that each time zone is formed as an individule CTzLocalizedCityGroup object since they do not belong to the same group.
If the database is empty the returned array will contain no elements.
@param aCities Array of groups.
@internalTechnology
*/
void CTzLocalizationUserDataReader::ReadAllGroupsL(CTzLocalizedCityGroupArray& aCities)
	{
	RPointerArray<CTzId> tzids;
	CleanupStack::PushL(TCleanupItem(ResetAndDestroyTzIdArray, &tzids));
	iUserData->GetTzIdsL(tzids);
	TInt count = tzids.Count();
	aCities.ReserveL(count + aCities.Count());
	for(TInt ii=0; ii<count; ++ii)
		{
		CTzLocalizedCityGroup* group = GetLocalizedCityGroupL(tzids[ii]->TimeZoneNumericID());
		aCities.AppendL(group);
		}
	CleanupStack::PopAndDestroy(&tzids);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:20,代码来源:tzlocalizationuserdatareader.cpp

示例9: TCleanupItem

// -----------------------------------------------------------------------------
// TUpnpSoapParser::UpdateActionWithRequestL
// Update action with all necessary information from
// a SOAP request message.
// -----------------------------------------------------------------------------
//
void TUpnpSoapParser::UpdateActionWithRequestL(
    CUpnpSoapMessage* aMessage, CUpnpAction* aAction )
    {
    if ( NULL == aMessage )
        {
        return;
        }
    RPointerArray<CUpnpDescriptionProperty> parsedArguments;
    CleanupStack::PushL( TCleanupItem( CleanupResetAndDestroy, &parsedArguments ) );

    UpdateActionL( aMessage, aAction, parsedArguments );
    ProcessActionArgumentsL( parsedArguments, aAction );
    CleanupStack::PopAndDestroy( &parsedArguments );
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:20,代码来源:upnpsoapparser.cpp

示例10: cleanSimpleEntryArray

/** Uid instance iterator ConstructL

Fetches all the related entries to the UID and sets the currently indexed time

@internalComponent
*/
void CCalInstanceIteratorUid::ConstructL(const TDesC8& aUid, const TCalTime& aInstanceTime, TCalCollectionId aCollectionId)
	{
	// record the time to use for undated todos
	TTime now;
	now.HomeTime();
	iUndatedTodoTime.SetTimeLocalL(now);
	
	// Fetch all the entries that relate to the instance
	RPointerArray<CAgnSimpleEntry> simpleEntries;
	TCleanSimpleEntryArray cleanSimpleEntryArray(simpleEntries, iInstanceViewImpl.GetServ());
	CleanupStack::PushL(TCleanupItem(CCalInstanceViewImpl::DestroySimpleEntryArray, &cleanSimpleEntryArray));
	RArray<TInt> fileIds;
	iInstanceViewImpl.GetShortFileIdLC(fileIds);//It is in order 
	iInstanceViewImpl.GetServ().FetchSimpleEntriesByGuidL(aUid, simpleEntries, fileIds);
	CleanupStack::PopAndDestroy(&fileIds);
	
	const TInt KEntryCount(simpleEntries.Count());
	
	// There must be entries associated with this UID
	__ASSERT_ALWAYS(KEntryCount != 0, User::Leave(KErrNotFound));
	
	TBool instanceExists(EFalse);
	
	for (TInt i(0) ; i < KEntryCount ; ++i)
		{
		CCalLiteEntry* liteEntry = CCalLiteEntry::NewL(*simpleEntries[0], iInstanceViewImpl.GetServ());
		liteEntry->IncrementRefCount();
		simpleEntries.Remove(0);
		TInt appendError = iCalLiteEntries.Append(liteEntry);	
		if (appendError != KErrNone)
			{
			liteEntry->DecrementRefCount();
			User::Leave(appendError);
			}
		
		if (iInstanceViewImpl.IsValidInstanceL(liteEntry->LiteEntry(), aInstanceTime))
			{//Add the index of the entry which has the same time as aInstanceTime into iEntryWithSameTime
			if(liteEntry->LiteEntry().CollectionId() == aCollectionId)
				{
				instanceExists = ETrue;
				iCurrentIndexTime = aInstanceTime;
				iCurrentIndex = iEntryWithSameTime.Count();
				}
			iEntryWithSameTime.AppendL(i);
			}
		}
	
	__ASSERT_ALWAYS(instanceExists, User::Leave(KErrNotFound));
	CleanupStack::PopAndDestroy(); // simpleEntries
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:56,代码来源:calinstanceiteratoruid.cpp

示例11: ReadAllTimeZonesL

/** Read all time zones stored in user database
@internalTechnology
@param aTimeZones array of localized time zones.
*/
void CTzLocalizationUserDataReader::ReadAllTimeZonesL(CTzLocalizedTimeZoneArray& aTimeZones)
	{
	RPointerArray<CTzId> tzids;
	CleanupStack::PushL(TCleanupItem(ResetAndDestroyTzIdArray, &tzids));
	iUserData->GetTzIdsL(tzids);
	const TInt count = tzids.Count();
	aTimeZones.ReserveL(count + aTimeZones.Count());
	for(TInt ii=0; ii<count; ++ii)
		{
		CTzLocalizedTimeZone* localizedTz = GetLocalizedTimeZoneL(tzids[ii]->TimeZoneNumericID());
		aTimeZones.AppendL(localizedTz);
		}
	CleanupStack::PopAndDestroy(&tzids);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:18,代码来源:tzlocalizationuserdatareader.cpp

示例12: LoadOMASUPLPluginsL

// -----------------------------------------------------------------------------
// COMASUPLProtocolManager::LoadOMASUPLPluginsL
// 
// -----------------------------------------------------------------------------
//
void COMASUPLProtocolManager::LoadOMASUPLPluginsL()
    {
	iTrace->Trace(_L("COMASUPLProtocolManager::LoadOMASUPLPlugins"), KTraceFileName, __LINE__); 
	
    const TUid KOMASUPLProtocolInterfaceUid 		= {0x102073CB};
    
    const TUid KOMASuplProtocolImplementationUid1 	= {0x2002678D};
    
    const TUid KOMASuplProtocolImplementationUid2 	= {0x2002678E};
    
    RImplInfoPtrArray pluginArray;
    
    REComSession& EComServerSession = REComSession::OpenL();
    
    CleanupStack::PushL(TCleanupItem(*ResetAndDestroy, &pluginArray));
    REComSession::ListImplementationsL(KOMASUPLProtocolInterfaceUid, pluginArray);
    
    if(pluginArray.Count() > 0)    
        {         
        TRAPD(err1,iOMASuplProtocolHandler1 = 
        				CSUPLProtocolManagerBase::NewL(KOMASuplProtocolImplementationUid1));
        				
        TBuf<64> buf(_L("OMA SUPL 1.0 Plugin loaded with error : "));
        buf.AppendNum(err1);
        iTrace->Trace(buf,KTraceFileName, __LINE__);        	

        TRAPD(err2,iOMASuplProtocolHandler2 = 
        				CSUPLProtocolManagerBase::NewL(KOMASuplProtocolImplementationUid2));
        				
        buf.Copy(_L("OMA SUPL 2.0 Plugin loaded with error : "));
        buf.AppendNum(err2);
        iTrace->Trace(buf,KTraceFileName, __LINE__);

        // if PH1 is not available but PH2 is,then use PH2 whenever there is reference to PH1.
        if( KErrNone != err1 && KErrNone == err2 )
            {
            isPH2Shared = ETrue;
            iOMASuplProtocolHandler1 = iOMASuplProtocolHandler2;
            }
        }
    else
        {
        iTrace->Trace(_L("No Plugins Found for OMA Implementation..."), KTraceFileName, __LINE__);
        User::LeaveIfError(KErrArgument);
        }   
        
    CleanupStack::PopAndDestroy(1);
    EComServerSession.Close();
    }
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:54,代码来源:epos_comasuplprotocolmanager.cpp

示例13: while

EXPORT_C void CSDL::SuspendRequestsLC(TInt aRunFirst)
    {
    TInt requestCount = 0;
    while(RThread().RequestCount())
        {
        User::WaitForAnyRequest();
        TInt err;
        /*potential problem is that idle objects may keep this
         * loop busy*/
        while(CActiveScheduler::RunIfReady(err, aRunFirst))
            {}
        ++requestCount;
        }
    CleanupStack::PushL(TCleanupItem(ReRequest, reinterpret_cast<TAny*>(requestCount)));
    }
开发者ID:a-team,项目名称:wormux,代码行数:15,代码来源:SDL_main.cpp

示例14: OpenEtelServerL

/**
@SYMTestCaseID BA-CTSY-ATD-MGATD-0001
@SYMComponent  telephony_ctsy
@SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetAirTimeDuration
@SYMTestPriority High
@SYMTestActions Invokes RMobilePhone::GetAirTimeDuration
@SYMTestExpectedResults Pass
@SYMTestType CT
*/
void CCTsyAirTimeDurationFU::TestGetAirTimeDuration0001L()
	{

	OpenEtelServerL(EUseExtendedError);
	CleanupStack::PushL(TCleanupItem(Cleanup,this));
	OpenPhoneL();

	TTimeIntervalSeconds time;
	TInt ret(iPhone.GetAirTimeDuration(time));
	ASSERT_EQUALS(KErrNotSupported, ret);

	AssertMockLtsyStatusL();
	CleanupStack::PopAndDestroy(this); 
	
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:24,代码来源:cctsyairtimedurationfu.cpp

示例15: IndexExistsL

/**
Returns true if at least one index using aCollationName exists.

@param aDbName Logical database name: "main" for the main database or attached database name,
@param aCollationName SQLITE collation name.
*/
TBool TSqlDbSysSettings::IndexExistsL(const TDesC& aDbName, const TDesC& aCollationName)
	{
	//KGetIndexSql will contain '%<CollationName>%' search pattern, while Symbian OS search patterns use '*' symbol by default.
	//This time the '%' is OK because the serach is performed in the SQLITE master table and before installing the
	//user-defined Like() function.
	HBufC* buf = HBufC::NewLC(sizeof(KGetIndexSql) + aDbName.Length() + aCollationName.Length());
	TPtr sql = buf->Des();
	sql.Format(KGetIndexSql(), &aDbName, &aCollationName);
	sqlite3_stmt* stmtHandle = ::StmtPrepare16L(iDbHandle, sql);
	CleanupStack::PushL(TCleanupItem(&FinalizeStatementHandle, stmtHandle));
	TInt rc = ::StmtNext(stmtHandle);
	CleanupStack::PopAndDestroy(2);//buf, cleanupItem (statement handle)
	__SQLLEAVE_IF_ERROR(rc);
	return rc == KSqlAtRow;
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:21,代码来源:SqlSrvDbSysSettings.cpp


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