commsfwutils/commsbufs/inc/commsbufskern.inl
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __COMMSBUFS_KERNEL_LIBRARY_INL__
       
    17 #define __COMMSBUFS_KERNEL_LIBRARY_INL__
       
    18 
       
    19 
       
    20 TInt DCommsBuf::Length() const
       
    21 	{
       
    22 	return iLength;
       
    23 	}
       
    24 
       
    25 void DCommsBuf::SetLength(TInt aLength)
       
    26 	{
       
    27 	__ASSERT_DEBUG((aLength >= 0) && ((aLength + iOffset) <= 0), KernCommsBuf::Fault(ECommsBufDimensionsOutOfBounds));
       
    28 	iLength = aLength;
       
    29 	}
       
    30 
       
    31 TInt DCommsBuf::Offset() const
       
    32 	{
       
    33 	return iOffset - iRawDataOffset;
       
    34 	}
       
    35 
       
    36 void DCommsBuf::SetOffset(TInt aOffset)
       
    37 	{
       
    38 	__ASSERT_DEBUG((aOffset >= 0) && ((aOffset + iLength) <= iRawSize), KernCommsBuf::Fault(ECommsBufDimensionsOutOfBounds));
       
    39 	iOffset = iRawDataOffset + aOffset;
       
    40 	}
       
    41 	
       
    42 TUint8* DCommsBuf::Ptr() const
       
    43 	{
       
    44 	return iCommsBufPtr + iOffset;
       
    45 	}
       
    46 
       
    47 TAny* DCommsBuf::operator new(TUint /* aSize */, const TUint8* aPtr)
       
    48 	{
       
    49 	return (TUint8*)aPtr;
       
    50 	}
       
    51 
       
    52 void DCommsBuf::operator delete(TAny* /* aPtr */, const TUint8*)
       
    53 	{
       
    54 	}
       
    55 
       
    56 
       
    57 #endif // __COMMSBUFS_KERNEL_LIBRARY_INL__
       
    58