os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tblocktransfer.h
First public contribution.
1 // Copyright (c) 2008-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 the License "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #ifndef TBLOCKTRANSFER_H
22 #define TBLOCKTRANSFER_H
24 class MBlockTransferProtocol;
27 Split the byte stream on block boundaries and transfer using
28 MBlockTransferProtocol interface in blocks
35 void InitBuffers(RBuf8* aHeadbuf, RBuf8* aTailbuf);
37 void ReadL(MBlockTransferProtocol& aProtocol,
42 void WriteL(MBlockTransferProtocol& aProtocol,
47 TUint32 BlockLength() const;
48 void SetCapacityL(TUint32 aBlockLength, TLba aLastLba);
51 TPos GetHeadBlockOffset(TPos aPos);
52 TLba GetHeadBlockLbaL(TPos aPos);
54 TPos GetTailBlockOffset(TPos aPos, TInt aLen);
55 TLba GetTailBlockLbaL(TPos aPos, TInt aLen);
60 /** Last Logical Block Address */
63 // buffers for block manipulation (not owend by this class)
70 inline TBlockTransfer::TBlockTransfer()
78 /** return the Block Length */
79 inline TUint32 TBlockTransfer::BlockLength() const
85 inline void TBlockTransfer::InitBuffers(RBuf8* aHeadbuf, RBuf8* aTailbuf)
91 #endif // TBLOCKTRANSFER_H