class RMsgQueue : public RMsgQueueBase |
A handle to a message queue.
The templated class provides the behaviour for managing an asynchronous queue of messages, where the template parameter defines the message type.
The class adds a type-checking interface to the basic message queue functionality provided by RMsgQueueBase.
Public Member Functions | |
---|---|
TInt | CreateGlobal(const TDesC &, TInt, TOwnerType) |
TInt | CreateLocal(TInt, TOwnerType) |
TInt | Receive(T &) |
void | ReceiveBlocking(T &) |
TInt | Send(const T &) |
void | SendBlocking(const T &) |
Inherited Enumerations | |
---|---|
RHandleBase:TAttributes | |
RMsgQueueBase:@198 |
Inherited Attributes | |
---|---|
RHandleBase::iHandle |
TInt | CreateGlobal | ( | const TDesC & | aName, |
TInt | aSize, | |||
TOwnerType | aType = EOwnerProcess | |||
) | [inline] |
Creates a global message queue, and opens a handle to that message queue.
If the name is non-empty, the message queue is visible to all processes. If the name is empty it cannot be opened or searched for by name, but a handle to it can be passed to another process as a process parameter or via IPC.
The size of each message in the queue is the size of the template parameter type. This must conform to the restrictions imposed on the aMsgLength parameter passed to the base class function RMsgQueueBase::CreateGlobal().
const TDesC & aName | The name to be assigned to the message queue. |
TInt aSize | The number of message 'slots' in the queue. This must be a positive value, i.e. greater than zero. |
TOwnerType aType = EOwnerProcess | The type of handle to be created. EOwnerProcess is the default value, if not explicitly specified. |
TInt | CreateLocal | ( | TInt | aSize, |
TOwnerType | aType = EOwnerProcess | |||
) | [inline] |
Creates a message queue that is private to the current process, and opens a handle to that message queue.
The size of each message in the queue is the size of the template parameter type. This must conform to the restrictions imposed on the aMsgLength parameter passed to the base class function RMsgQueueBase::CreateLocal().
TInt aSize | The number of message 'slots' in the queue. This must be a positive value, i.e. greater than zero. |
TOwnerType aType = EOwnerProcess | The type of handle to be created. EOwnerProcess is the default value, if not explicitly specified. |
TInt | Receive | ( | T & | aMsg | ) | [inline] |
Retrieves the first message in the queue.
The function does not wait (i.e. block), if the queue is empty.
The function is implemented through a call to RMsgQueueBase::Receive().
T & aMsg | The object into which the message is retrieved. |
void | ReceiveBlocking | ( | T & | aMsg | ) | [inline] |
Retrieves the first message in the queue, and waits if the queue is empty.
The function uses NotifyDataAvailable() to provide the blocking operation. Note it is not possible to cancel a call to ReceiveBlocking().
The function is implemented through a call to RMsgQueueBase::ReceiveBlocking().
T & aMsg | The object into which the message is retrieved. |
TInt | Send | ( | const T & | aMsg | ) | [inline] |
Sends a message through this queue.
The function does not wait (i.e. block), if the queue is full.
The function is implemented through a call to RMsgQueueBase::Send().
const T & aMsg | The message data to be sent. |
void | SendBlocking | ( | const T & | aMsg | ) | [inline] |
Sends a message through this queue, and waits for space to become available if the queue is full.
The function uses NotifySpaceAvailable() to provide the blocking operation. Note that it is not possible to cancel a call to SendBlocking().
The function is implemented through a call to RMsgQueueBase::SendBlocking().
const T & aMsg | The message data to be sent. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.