harvester/monitorplugins/inc/mdsfspqueue.inl
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 18 Aug 2010 10:12:07 +0300
changeset 45 a93990e5815e
parent 0 c53acadfccc6
child 60 79f826a55db2
child 63 e538444823de
permissions -rw-r--r--
Revision: 201031 Kit: 201033

/*
* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Queue/cache item for file server plugin events*
*/




//-----------------------------------------------------------------------------
// CMdsFSPQueueItem::NewL()
//-----------------------------------------------------------------------------
//
CMdsFSPQueueItem* CMdsFSPQueueItem::NewL()
	{
	CMdsFSPQueueItem *self = new (ELeave) CMdsFSPQueueItem();
	return self;
	}


//-----------------------------------------------------------------------------
// CMdsFSPQueueItem::NewL()
//-----------------------------------------------------------------------------
//
CMdsFSPQueueItem* CMdsFSPQueueItem::NewL( TMdsFSPStatus& aStatus )
	{
	CMdsFSPQueueItem *self = new (ELeave) CMdsFSPQueueItem();
	CleanupStack::PushL( self );
	self->SetStatusL( aStatus );
	CleanupStack::Pop( self );
	return self;
	}

//-----------------------------------------------------------------------------
// CMdsFSPQueueItem::GetAsFspStatus()
//-----------------------------------------------------------------------------
//
void CMdsFSPQueueItem::GetAsFspStatus( TMdsFSPStatus& aStatus )
	{
	aStatus.iDriveNumber = iDriveNumber;
	aStatus.iFileName.Copy( *iFileName );
	aStatus.iNewFileName.Copy( *iNewFileName );
	aStatus.iFileEventType = iFileEventType;
	aStatus.iProcessId = iProcessId;
	}

//-----------------------------------------------------------------------------
// CMdsFSPQueueItem::SetStatus()
//-----------------------------------------------------------------------------
//
void CMdsFSPQueueItem::SetStatusL( TMdsFSPStatus& aStatus )
	{
	iDriveNumber = aStatus.iDriveNumber;
	iFileEventType = aStatus.iFileEventType;
	iProcessId = aStatus.iProcessId;

	if( iFileName ) 
		{
		delete iFileName;
		iFileName = NULL;
		}
	
	if( iNewFileName )
		{
		delete iNewFileName;
		iNewFileName = NULL;
		}
	
	iFileName = aStatus.iFileName.AllocL();
	iNewFileName = aStatus.iNewFileName.AllocL();
	
	}

//-----------------------------------------------------------------------------
// CMdsFSPQueueItem::~CMdsFSPQueueItem()
//-----------------------------------------------------------------------------
//
CMdsFSPQueueItem::~CMdsFSPQueueItem()
	{
	delete iFileName;
	iFileName = NULL;
	delete iNewFileName;
	iNewFileName = NULL;
	}