1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kernel/eka/include/e32msgqueue.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,91 @@
1.4 +// Copyright (c) 2002-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 +// e32\include\e32msgqueue.h
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __E32MSGQUEUE_H__
1.22 +#define __E32MSGQUEUE_H__
1.23 +
1.24 +#include <e32std.h>
1.25 +
1.26 +
1.27 +
1.28 +
1.29 +class RMsgQueueBase : public RHandleBase
1.30 +/**
1.31 +@publishedAll
1.32 +@released
1.33 +
1.34 +Provides implementation for managing an asynchronous message queue,
1.35 +and is a base class for the RMsgQueue templated class.
1.36 +
1.37 +@see RMsgQueue
1.38 +*/
1.39 + {
1.40 +public:
1.41 + /**
1.42 + The limit for the size of an individual message.
1.43 + */
1.44 + enum {KMaxLength = 256};
1.45 +
1.46 +public:
1.47 +
1.48 + IMPORT_C TInt CreateLocal(TInt aSize, TInt aMsgLength, TOwnerType aType=EOwnerProcess);
1.49 + IMPORT_C TInt CreateGlobal(const TDesC& aName, TInt aSize, TInt aMsgLength, TOwnerType aType=EOwnerProcess);
1.50 + IMPORT_C TInt OpenGlobal(const TDesC& aName, TOwnerType aType=EOwnerProcess);
1.51 + IMPORT_C TInt Open(RMessagePtr2 aMessage, TInt aParam, TOwnerType aType=EOwnerProcess);
1.52 + IMPORT_C TInt Open(TInt aArgumentIndex, TOwnerType aType=EOwnerProcess);
1.53 + IMPORT_C TInt Send(const TAny* aPtr, TInt aLength);
1.54 + IMPORT_C void SendBlocking(const TAny* aPtr, TInt aLength);
1.55 + IMPORT_C TInt Receive(TAny* aPtr, TInt aLength);
1.56 + IMPORT_C void ReceiveBlocking(TAny* aPtr, TInt aLength);
1.57 + IMPORT_C void NotifySpaceAvailable(TRequestStatus& aStatus);
1.58 + IMPORT_C void CancelSpaceAvailable();
1.59 + IMPORT_C void NotifyDataAvailable(TRequestStatus& aStatus);
1.60 + IMPORT_C void CancelDataAvailable();
1.61 + IMPORT_C TInt MessageSize();
1.62 + };
1.63 +
1.64 +
1.65 +
1.66 +
1.67 +/**
1.68 +@publishedAll
1.69 +@released
1.70 +
1.71 +A handle to a message queue.
1.72 +
1.73 +The templated class provides the behaviour for managing an
1.74 +asynchronous queue of messages, where the template parameter defines the
1.75 +message type.
1.76 +
1.77 +The class adds a type-checking interface to the basic message queue
1.78 +functionality provided by RMsgQueueBase.
1.79 +*/
1.80 +template <typename T>
1.81 +class RMsgQueue : public RMsgQueueBase
1.82 + {
1.83 +public:
1.84 + TInt CreateLocal(TInt aSize, TOwnerType aType=EOwnerProcess);
1.85 + TInt CreateGlobal(const TDesC& aName, TInt aSize, TOwnerType aType=EOwnerProcess);
1.86 + TInt Send(const T& aMsg);
1.87 + void SendBlocking(const T& aMsg);
1.88 + TInt Receive(T& aMsg);
1.89 + void ReceiveBlocking(T& aMsg);
1.90 + };
1.91 +
1.92 +#include <e32msgqueue.inl>
1.93 +
1.94 +#endif