Contents
Inheritance:
Constructors:
MsgQueue AbsMsgQueue *createMsgQueue(unsigned int maxln)
Methods:
Constructors
MsgQueue
A message queue.
Constructor:
MsgQueue(unsigned int maxln)
Factory Method:
AbsMsgQueue *AbsMsgQueueInterface::createMsgQueue(unsigned int maxln)
Wrapper Class:
MsgQueueWrapper(unsigned int maxln)
The static method
AbsMsgQueueInterface::createMsgQueue creates a new instance of class MsgQueue.
Parameters:
| unsigned int | maxln | | The initial amount of memory to allocate. The queue will be able to hold up to maxln items without reallocation of memory. |
Return value:Returns an instance of
MsgQueue.
Methods
enqueue (version 1)
Inserts a new item at the end of the queue.
Signature:
int enqueue(uint64_t msgID,uint64_t msgParam,uint64_t msgFlags,void *data)
Parameters:
| uint64_t | msgID | | The ID of the message. |
| uint64_t | msgParam | | The parameter of the message. |
| uint64_t | msgFlags | | The flags of the message. |
| void * | data | | Additional data the message carries. |
Return value:Returns 0 if successful, otherwise a value other than 0.
enqueue (version 2)
Inserts a new item at the end of the queue.
Signature:
int enqueue(uint64_t msgID,uint64_t msgFlags,void *data)
Parameters:
| uint64_t | msgID | | The ID of the message. |
| uint64_t | msgFlags | | The flags of the message. |
| void * | data | | Additional data the message carries. |
Return value:Returns 0 if successful, otherwise a value other than 0.
enqueue (version 3)
Inserts a new item at the end of the queue.
Signature:
int enqueue(uint64_t msgID,uint64_t msgParam)
Parameters:
| uint64_t | msgID | | The ID of the message. |
| uint64_t | msgParam | | The parameter of the message. |
Return value:Returns 0 if successful, otherwise a value other than 0.
enqueue (version 4)
Inserts a new item at the end of the queue.
Signature:
int enqueue(uint64_t msgID)
Parameters:
| uint64_t | msgID | | The ID of the message. |
Return value:Returns 0 if successful, otherwise a value other than 0.
enqueue (version 5)
Inserts a new item at the end of the queue.
Signature:
int enqueue(AbsMsgItem *msgItem)
Parameters:
| AbsMsgItem * | msgItem | [IN] | A message to be put an the queue. |
Return value:Returns 0 if successful, otherwise a value other than 0.
dequeue
Returns the Item on the Top of the queue and removes it from the queue.
Signature:
AbsMsgItem *dequeue()
Return value:The topmost item of the queue
peek
Returns the Item on the Top of the queue (without removing it).
Signature:
AbsMsgItem *peek()
Return value:The topmost item of the queue
isEmpty
Tests if the queue is empty.
Signature:
bool isEmpty()
Return value:Returns
true, if the queue is empty and
false otherwise.
length
Returns the number of items items queue.
Signature:
unsigned int length()
Return value:the length of the queue.
print
Printing debug info.
Signature:
void print()