commsfwutils/commsbufs/inc/commsbufiter.inl
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 14 Sep 2010 23:38:38 +0300
branchRCL_3
changeset 27 5ebd530e523b
parent 0 dfb7c4ff071f
permissions -rw-r--r--
Revision: 201035 Kit: 201035

// Copyright (c) 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:
//

inline TCommsBufIter::TCommsBufIter(RCommsBufChain& aChain)
: iCurrent(aChain.First())
/**
Construct an iterator for the RCommsBuf using the supplied chain
*/
	{
	}

inline TCommsBufIter::TCommsBufIter(RCommsBuf* aBuf)
: iCurrent(aBuf)
/**
Construct an iterator for the RCommsBuf using the supplied RCommsBuf
*/
	{
	}

inline TCommsBufIter TCommsBufIter::operator++ (TInt)
/**
Advance the iterator
*/
	{
	TCommsBufIter it(iCurrent);
	if (iCurrent != NULL)
		iCurrent = iCurrent->Next();
	return it;
	}
inline TCommsBufIter& TCommsBufIter::operator++ ()
/**
Advance the iterator
*/
	{
	if (iCurrent != NULL)
		iCurrent = iCurrent->Next();
	return *this;
	}

inline RCommsBuf* TCommsBufIter::Current()
/**
Returns the pointer to  the current RCommsBuf
*/
	{
	return iCurrent;
	}

inline TBool TCommsBufIter::AtEnd() const
/**
Check if the iterator is at the end. If so, further calls to TCommsBufIter::Current returns NULL.

@return ETrue if the iterator is reached the end
*/
	{
	return iCurrent == NULL;
	}

inline TCommsBufIter::TCommsBufIter()
: iCurrent(NULL)
/**
The constructor
*/
	{
	}