epoc32/include/e32msgqueue.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/e32msgqueue.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/e32msgqueue.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,91 @@
     1.4 -e32msgqueue.h
     1.5 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +// e32\include\e32msgqueue.h
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +#ifndef __E32MSGQUEUE_H__
    1.23 +#define __E32MSGQUEUE_H__
    1.24 +
    1.25 +#include <e32std.h>
    1.26 +
    1.27 +
    1.28 +
    1.29 +
    1.30 +class RMsgQueueBase : public RHandleBase
    1.31 +/**
    1.32 +@publishedAll
    1.33 +@released
    1.34 +
    1.35 +Provides implementation for managing an asynchronous message queue,
    1.36 +and is a base class for the RMsgQueue templated class.
    1.37 +
    1.38 +@see RMsgQueue
    1.39 +*/
    1.40 +	{
    1.41 +public:
    1.42 +	/**
    1.43 +	The limit for the size of an individual message.
    1.44 +	*/
    1.45 +	enum {KMaxLength = 256};
    1.46 +
    1.47 +public:
    1.48 +
    1.49 +	IMPORT_C TInt CreateLocal(TInt aSize, TInt aMsgLength, TOwnerType aType=EOwnerProcess);
    1.50 +	IMPORT_C TInt CreateGlobal(const TDesC& aName, TInt aSize, TInt aMsgLength, TOwnerType aType=EOwnerProcess);
    1.51 +	IMPORT_C TInt OpenGlobal(const TDesC& aName, TOwnerType aType=EOwnerProcess);
    1.52 +	IMPORT_C TInt Open(RMessagePtr2 aMessage, TInt aParam, TOwnerType aType=EOwnerProcess);
    1.53 +	IMPORT_C TInt Open(TInt aArgumentIndex, TOwnerType aType=EOwnerProcess);
    1.54 +	IMPORT_C TInt Send(const TAny* aPtr, TInt aLength);
    1.55 +	IMPORT_C void SendBlocking(const TAny* aPtr, TInt aLength);
    1.56 +	IMPORT_C TInt Receive(TAny* aPtr, TInt aLength);
    1.57 +	IMPORT_C void ReceiveBlocking(TAny* aPtr, TInt aLength);
    1.58 +	IMPORT_C void NotifySpaceAvailable(TRequestStatus& aStatus);
    1.59 +	IMPORT_C void CancelSpaceAvailable();
    1.60 +	IMPORT_C void NotifyDataAvailable(TRequestStatus& aStatus);
    1.61 +	IMPORT_C void CancelDataAvailable();
    1.62 +	IMPORT_C TInt MessageSize();
    1.63 +	};
    1.64 +
    1.65 +
    1.66 +
    1.67 +
    1.68 +/**
    1.69 +@publishedAll
    1.70 +@released
    1.71 +
    1.72 +A handle to a message queue.
    1.73 +
    1.74 +The templated class provides the behaviour for managing an
    1.75 +asynchronous queue of messages, where the template parameter defines the
    1.76 +message type.
    1.77 +
    1.78 +The class adds a type-checking interface to the basic message queue
    1.79 +functionality provided by RMsgQueueBase.
    1.80 +*/
    1.81 +template <typename T>
    1.82 +class RMsgQueue : public RMsgQueueBase
    1.83 +	{
    1.84 +public:
    1.85 +	TInt CreateLocal(TInt aSize, TOwnerType aType=EOwnerProcess);
    1.86 +	TInt CreateGlobal(const TDesC& aName, TInt aSize, TOwnerType aType=EOwnerProcess);
    1.87 +	TInt Send(const T& aMsg);
    1.88 +	void SendBlocking(const T& aMsg);
    1.89 +	TInt Receive(T& aMsg);
    1.90 +	void ReceiveBlocking(T& aMsg);
    1.91 +	};
    1.92 +
    1.93 +#include <e32msgqueue.inl>
    1.94 +
    1.95 +#endif