本文整理汇总了C++中TPckgBuf::Copy方法的典型用法代码示例。如果您正苦于以下问题:C++ TPckgBuf::Copy方法的具体用法?C++ TPckgBuf::Copy怎么用?C++ TPckgBuf::Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPckgBuf
的用法示例。
在下文中一共展示了TPckgBuf::Copy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Compensate
// ---------------------------------------------------------------------------
// CSensorDataCompensatorAxisDataHandler::Compensate
// ---------------------------------------------------------------------------
//
TInt CSensorDataCompensatorAxisDataHandler::Compensate( TDes8& aData )
{
FUNC_LOG;
TInt err( KErrNone );
TInt x( 0 );
TInt y( 0 );
TInt z( 0 );
TRACE_MATRIX( "Axis data compensation matrix", iMatrix );
if ( KSensrvChannelTypeIdMagnetometerXYZAxisData == iDataType )
{
INFO( "Compensating magnetometer data" );
TPckgBuf<TSensrvMagnetometerAxisData> pckg;
if ( aData.MaxSize() == pckg.MaxSize() )
{
pckg.Copy( aData );
iMatrix.Transform( x, y, z, pckg().iAxisXRaw, pckg().iAxisYRaw, pckg().iAxisZRaw );
INFO_3( "Compensated data Magnetometer raw [X: %d], [Y: %d], [Z: %d]", x, y, z );
pckg().iAxisXRaw = x;
pckg().iAxisYRaw = y;
pckg().iAxisZRaw = z;
iMatrix.Transform( x, y, z, pckg().iAxisXCalibrated, pckg().iAxisYCalibrated, pckg().iAxisZCalibrated );
INFO_3( "Compensated data Magnetometer calib [X: %d], [Y: %d], [Z: %d]", x, y, z );
pckg().iAxisXCalibrated = x;
pckg().iAxisYCalibrated = y;
pckg().iAxisZCalibrated = z;
aData.Copy( pckg );
}
else
{
err = KErrArgument;
}
}
else
{
INFO( "Compensating accelerometer data" );
TPckgBuf<TSensrvAccelerometerAxisData> pckg;
if ( aData.MaxSize() == pckg.MaxSize() )
{
pckg.Copy( aData );
iMatrix.Transform( x, y, z, pckg().iAxisX, pckg().iAxisY, pckg().iAxisZ );
INFO_3( "Compensated data accelerometer[X: %d], [Y: %d], [Z: %d]", x, y, z );
pckg().iAxisX = x;
pckg().iAxisY = y;
pckg().iAxisZ = z;
aData.Copy( pckg );
}
else
{
err = KErrArgument;
}
}
ERROR( err, "Axis data compensation error" );
return err;
}
示例2: TestDeleteStoreOperationL
LOCAL_C void TestDeleteStoreOperationL()
{
CMsgsTestUtils::SetDriveL(EDriveC);
CSessionObserver* ob = new(ELeave)CSessionObserver;
CleanupStack::PushL(ob);
// Set session in observer
CMsvSession* session = CMsvSession::OpenAsyncL(*ob);
ob->iSession = session;
CleanupStack::PushL(session);
CActiveScheduler::Start();
test(ob->iType==MMsvSessionObserver::EMsvServerReady);
CTestActive* active = new(ELeave)CTestActive;
CleanupStack::PushL(active);
// Test Delete MailStore
active->StartL();
CMsvOperation* operation = NULL;
TDriveUnit unit =(EDriveD);
operation = session->DeleteStoreL(unit, active->iStatus);
test(operation->Mtm() == KUidMsvServerMtm);
CleanupStack::PushL(operation);
CActiveScheduler::Start();
//Retrieve progress
TPckgBuf<TMsvCopyProgress> package;
package.Copy(operation->ProgressL());
test((package().iError == KErrNone) || (package().iError == KErrPathNotFound)) ;
CleanupStack::PopAndDestroy(4);
}
示例3: SaveL
// ---------------------------------------------------------------------------
// CNATFWTraversalAdapter::SaveL
//
// ---------------------------------------------------------------------------
//
void CNATFWTraversalAdapter::SaveL( TInt aIndex )
{
DBG_PRINT( "CNATFWTraversalAdapter::SaveL - begin" );
CWPNATFWItem* cNATFWItem = iDatas[aIndex];
const TInt iapItemCount( iDatas[aIndex]->IAPItems().Count() );
for ( TInt counter = 0; counter < iapItemCount; counter++ )
{
// Set access point ID to current IAP item (access point is always
// stored before NAT/FW settings).
CNATFWIAPSpecificItem* cIapItem = iDatas[aIndex]->IAPItems()[counter];
if ( cIapItem->NapDef() )
{
// Get WAP ID.
TPckgBuf<TUint32> uid;
uid.Copy( cIapItem->NapDef()->Data( 0 ) );
TUint32 wapId( uid() );
// Get corresponding IAP ID.
TUint32 iapId = IapIdFromWapIdL( wapId );
cIapItem->SetIAPId( iapId );
}// if
cIapItem = NULL;
}
cNATFWItem->StoreL();
cNATFWItem = NULL;
DBG_PRINT( "CNATFWTraversalAdapter::SaveL - end" );
}
示例4: SetParameterL
// -----------------------------------------------------------------------------
// CMceComAvSink::SetParameterL
// -----------------------------------------------------------------------------
//
TBool CMceComAvSink::SetParameterL(
const CMceComEndpoint& aClient,
TUint32 aParam,
const TDesC8& aValue )
{
// At the moment, only supported parameter is volume for speaker
//
if ( aClient.iType != KMceSpeakerSink || aParam != KMccSpeakerVolume )
{
return KMceSrvStreamDefaultSequence;
}
__ASSERT_ALWAYS( ServesProxyClient( aClient ), User::Leave( KErrNotFound ) );
__ASSERT_ALWAYS( aClient.MediaStream() && aClient.MediaStream()->Session(),
User::Leave( KErrNotFound ) );
CMceMediaManager& manager =
aClient.MediaStream()->Session()->SdpSession().Manager();
TPckgBuf<TInt> volBuf;
volBuf.Copy( aValue );
iVolume = volBuf();
if ( aClient.IsEnabled() )
{
manager.SetMccParameterL(
static_cast<const CMceComMediaSink&>( aClient ), aParam, aValue );
}
return KMceSrvStreamAlternativeSequence;
}
示例5: DeleteL
// -----------------------------------------------------------------------------
// CNSmlDsProvisioningAdapter::DeleteL
// -----------------------------------------------------------------------------
void CNSmlDsProvisioningAdapter::DeleteL( const TDesC8& aSaveData)
{
_DBG_FILE("CNSmlDsProvisioningAdapter::DeleteL(): begin");
TPckgBuf<TInt> uid;
uid.Copy( aSaveData );
iSession.DeleteProfileL( uid() );
_DBG_FILE("CNSmlDsProvisioningAdapter::DeleteL(): end");
}
示例6: HandleGetArtistResponse
/**
Extracts the artist from the 'get artist' response data and calls
the relevant mixin function on the observer.
@param The data passed with the response.
*/
void CRemConTrackInfoController::HandleGetArtistResponse(TInt aError, const TDesC8& aData)
{
LOG_FUNC
TPckgBuf<TName> buf;
buf.Copy((aData.Mid(KRemConExtApi1ResultDataLength)));
iObserver.MrcticoGetArtistResponse(aError, buf());
}
示例7: ForwardL
CMsvOperation* CTextMtmClient::ForwardL(TMsvId aForwardEntryId, TMsvPartList aPartList,
TRequestStatus& aCompletionStatus)
// Create forwarded message
// Destination folder is aForwardEntryL
//
{
__ASSERT_DEBUG(iMsvEntry!=NULL,gPanic(ETxtcNoCMsvEntrySet));
__ASSERT_DEBUG(iMsvEntry->Entry().iType.iUid == KUidMsvMessageEntryValue, gPanic(ETxtcEntryTypeNotSupported));
__ASSERT_DEBUG(iMsvEntry->Entry().iServiceId == KMsvLocalServiceIndexEntryId, gPanic(ETxtcInvalidServiceId));
// Create the forwarded index entry
TMsvEntry forwardEntry;
forwardEntry.iMtm = KUidMsgTypeText;
forwardEntry.iServiceId = Entry().Entry().iServiceId;
forwardEntry.iType = KUidMsvMessageEntry;
forwardEntry.iDetails.Set(iMsvEntry->Entry().iDetails);
forwardEntry.iSize = iMsvEntry->Entry().iSize;
if(aPartList&KMsvMessagePartDate)
forwardEntry.iDate.HomeTime();
if(aPartList&KMsvMessagePartDescription)
forwardEntry.iDescription.Set(iMsvEntry->Entry().iDescription);
// Get CMsvEntry for destination (parent)
CMsvEntry* cEntry = CMsvEntry::NewL(Session(), aForwardEntryId, TMsvSelectionOrdering());
CleanupStack::PushL(cEntry);
// Synchronously create new child
CMsvOperationActiveSchedulerWait* wait = CMsvOperationActiveSchedulerWait::NewLC();
CMsvOperation* opert = cEntry->CreateL(forwardEntry, wait->iStatus);
CleanupStack::PushL(opert);
wait->Start();
User::LeaveIfError(opert->iStatus.Int());
// Check result
TPckgBuf<TMsvLocalOperationProgress> progressPack;
progressPack.Copy(opert->ProgressL());
TMsvLocalOperationProgress progress = progressPack();
User::LeaveIfError(progress.iError);
CleanupStack::PopAndDestroy(2); // opert, wait
// Get CMsvEntry for new entry
TMsvId forwardId=progress.iId;
cEntry->SetEntryL(forwardId);
// Populate new forwarded message with Body text
if(aPartList&KMsvMessagePartBody)
{
CMsvStore* store=cEntry->EditStoreL();
CleanupStack::PushL(store);
StoreBodyL(*store); // Current context is original message
store->CommitL();
CleanupStack::PopAndDestroy(); // store
}
CleanupStack::PopAndDestroy(); // cEntry
// Request was performed synchronously, so return a completed operation object
return CMsvCompletedOperation::NewL(Session(), KUidMsgTypeText, progressPack,
KMsvNullIndexEntryId, aCompletionStatus);
}
示例8: HandleGetTrackDurationResponse
/**
Extracts the track duration from the 'get track duration' response data and calls
the relevant mixin function on the observer.
@param The data passed with the response.
*/
void CRemConTrackInfoController::HandleGetTrackDurationResponse(TInt aError, const TDesC8& aData)
{
LOG_FUNC
TPckgBuf<TInt64> buf;
buf.Copy((aData.Mid(KRemConExtApi1ResultDataLength)));
TTime duration(buf());
iObserver.MrcticoGetTrackDurationResponse(aError, duration);
}
示例9: ConstructSourceL
// -----------------------------------------------------------------------------
// CMccFileSource::ConstructSourceL
// -----------------------------------------------------------------------------
//
void CMccFileSource::ConstructSourceL( const TDesC8& aInitData )
{
iSourceImpl = CMccFileSourceImpl::NewL(
MCC_ENDPOINT_ID( static_cast<MDataSource*>( this ) ) );
TPckgBuf<TFileName> initData;
initData.Copy( aInitData );
OpenFileL( initData() );
}
示例10: Update
// ---------------------------------------------------------------------------
// CSensorDataCompensatorAxisDataHandler::Update
// ---------------------------------------------------------------------------
//
TInt CSensorDataCompensatorAxisDataHandler::Update()
{
FUNC_LOG;
TInt err( KErrNone );
TInt count = iPlugin.GetCompensationItemCount();
INFO_1( "Axis compensation item count %d", count );
iMatrix.SetIdentity(); // Reset compensation
if ( count >= 0 )
{
// Calculate final compensation angles and create compensation matrix
TPckgBuf<TCompensationTypeAxisData> pckg;
TInt x( 0 );
TInt y( 0 );
TInt z( 0 );
TSensorDataCompensatorMatrix m;
TSensorDataCompensatorMatrix m2;
for ( TInt i( 0 ) ; i < count; i++ )
{
TPtrC8 data( iPlugin.GetCompensationItem( i ) );
if ( data.Size() == pckg.MaxSize() )
{
pckg.Copy( data );
x = pckg().iAxisX;
y = pckg().iAxisY;
z = pckg().iAxisZ;
}
else
{
err = KErrCorrupt;
break;
}
m.SetRotateX( x );
m2.SetRotateY( y );
m *= m2; // xy
m2.SetRotateZ( z );
m *= m2; // xy * z
iMatrix *= m;
}
if ( err != KErrNone )
{
iMatrix.SetIdentity();
}
}
else
{
// Error occured in plugin
err = count;
}
iCompensate = ( count > 0 ) && ( err == KErrNone ); // Ready to compensate
ERROR( err, "Axis update error" );
return err;
}
示例11: queueSizeBuf
void CWin32Socket::Listen(TWin32Message& aMessage)
{
TPckgBuf<TUint> queueSizeBuf;
queueSizeBuf.Copy(aMessage.ReadBuffer());
TUint& queueSize = queueSizeBuf();
if (listen(iSocket, queueSize))
{
aMessage.Complete(MapWinSockError(WSAGetLastError()));
}
else
{
aMessage.Complete(KErrNone);
}
}
示例12: Panic
void CWin32Socket::Accept(TWin32Message& aMessage)
{
__ASSERT_DEBUG(iAcceptMessage == NULL, Panic(EWinSockPrtCWin32SocketMultipleAcceptRequests));
__ASSERT_DEBUG(iBlankAcceptSocket == NULL, Panic(EWinSockPrtCWin32SocketAcceptBlankSocketNotNull));
iAcceptMessage = &aMessage;
WSP_LOG(WspLog::Printf(_L("CWin32Socket::Accept: this: 0x%x"), this));
if (WSAEventSelect(iSocket, iEvent, FD_ACCEPT) == SOCKET_ERROR)
{
Complete(iAcceptMessage, MapWinSockError(WSAGetLastError()));
}
TPckgBuf<TInt> newSocketHandleBuf;
newSocketHandleBuf.Copy(iAcceptMessage->ReadBuffer());
iBlankAcceptSocket = (CWin32Socket*)newSocketHandleBuf();
}
示例13: VisitL
// -----------------------------------------------------------------------------
// CResultCollector::VisitL
// -----------------------------------------------------------------------------
//
void CResultCollector::VisitL( CNSPTest& aTest )
{
CBufFlat* buffer = CBufFlat::NewL( 300 );
CleanupStack::PushL( buffer );
RBufWriteStream stream;
stream.Open( *buffer );
CleanupClosePushL( stream );
aTest.ExternalizeL( stream );
TPckgBuf<TResult> pkgIn;
pkgIn.Copy( buffer->Ptr(0) );
PrintResult( pkgIn() );
CleanupStack::PopAndDestroy();
CleanupStack::PopAndDestroy( buffer );
}
示例14: paramPack
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
//
TInt CIpsPlgPop3ConnectOp::GetOperationErrorCodeL( )
{
FUNC_LOG;
if ( !iSubOperation )
{
return KErrNotFound;
}
if ( !iSubOperation->IsActive() && iSubOperation->iStatus.Int() != KErrNone )
{
return iSubOperation->iStatus.Int();
}
TPckgBuf<TPop3Progress> paramPack;
paramPack.Copy( iSubOperation->ProgressL() );
const TPop3Progress& progress = paramPack();
return progress.iErrorCode;
}
示例15: GetHeapL
EXPORT_C CMemSpyApiHeap* RMemSpySession::GetHeapL()
{
CMemSpyApiHeap* aHeap;
HBufC8* buffer = HBufC8::NewLC( sizeof(TMemSpyHeapData) );
TPtr8 bufferPtr(buffer->Des());
TIpcArgs args( &bufferPtr );
User::LeaveIfError(SendReceive( EMemSpyClientServerOpGetHeap, args ));
TPckgBuf<TMemSpyHeapData> data;
data.Copy(bufferPtr.Ptr(), sizeof(TMemSpyHeapData));
aHeap = CMemSpyApiHeap::NewL( data() );
CleanupStack::PopAndDestroy(buffer);
return aHeap;
}