1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/f32test/concur/cfafshmem.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,53 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// /os/kernelhwsrv/kerneltest/f32test/concur/cfafshmem.h
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __CFAFSHMEM_H__
1.22 +#define __CFAFSHMEM_H__
1.23 +
1.24 +#include <f32file.h>
1.25 +#include <d32locd.h>
1.26 +#include <e32test.h>
1.27 +#include "t_server.h"
1.28 +
1.29 +const TInt KNoMessage = 0;
1.30 +const TInt KNoOffset = 0;
1.31 +
1.32 +class THMem
1.33 +/**
1.34 + * Memory base class.
1.35 + */
1.36 + {
1.37 + private:
1.38 + /// Copy constructor and assignment operator shall not be implemented.
1.39 + THMem(const THMem&);
1.40 + THMem& operator=(const THMem&);
1.41 +
1.42 + public:
1.43 + THMem(void * aNewMemPtr);
1.44 + THMem(const void * aNewMemPtr, const RMessagePtr2 &aMessage, int aNewOffset=0);
1.45 + TInt Read(void *aBuf, TUint32 aLength, TUint aOffset = 0) const;
1.46 + TInt Write(const void *aBuf, TUint32 aLength, TUint32 aOffset = 0);
1.47 + inline operator TUint8*() const { return (TUint8*)(iMemPtr); }
1.48 + inline operator TUint16*() const { return (TUint16*)(iMemPtr); }
1.49 + inline operator TUint32*() const { return (TUint32*)(iMemPtr); }
1.50 + private:
1.51 + void* iMemPtr;
1.52 + RMessagePtr2* iMessage;
1.53 + TInt iBaseOffset;
1.54 + };
1.55 +
1.56 +#endif