kerneltest/f32test/concur/cfafshmem.h
changeset 0 a41df078684a
child 33 0173bcd7697c
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 1997-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // /os/kernelhwsrv/kerneltest/f32test/concur/cfafshmem.h
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __CFAFSHMEM_H__
       
    19 #define __CFAFSHMEM_H__
       
    20 
       
    21 #include <f32file.h>
       
    22 #include <e32test.h>
       
    23 #include "t_server.h"
       
    24 
       
    25 const TInt KNoMessage = 0;
       
    26 const TInt KNoOffset = 0;
       
    27 
       
    28 class THMem
       
    29 /**
       
    30  * Memory base class.
       
    31  */
       
    32     {
       
    33     private:
       
    34         /// Copy constructor and assignment operator shall not be implemented.
       
    35         THMem(const THMem&);
       
    36         THMem& operator=(const THMem&);
       
    37 
       
    38     public:
       
    39         THMem(void * aNewMemPtr);
       
    40         THMem(const void * aNewMemPtr, const RMessagePtr2 &aMessage, int aNewOffset=0);
       
    41         TInt Read(void *aBuf, TUint32 aLength, TUint aOffset = 0) const;
       
    42         TInt Write(const void *aBuf, TUint32 aLength, TUint32 aOffset = 0);
       
    43         inline operator TUint8*()  const { return (TUint8*)(iMemPtr); }
       
    44         inline operator TUint16*() const { return (TUint16*)(iMemPtr); }
       
    45         inline operator TUint32*() const { return (TUint32*)(iMemPtr); }
       
    46     private:
       
    47         void*         iMemPtr;
       
    48         RMessagePtr2* iMessage;
       
    49         TInt          iBaseOffset;
       
    50     };
       
    51 
       
    52 #endif