If the RT and the server part are NOT in the same process, the POSIX message queue is used. The class provides the structure of the POSIX message queue and its corresponding functions. More...
#include <IpcMsgQueue.h>
Public Member Functions | |
IpcMsgQueue (const std::string &name, uint32_t queuelength, bool blocking) | |
Constructor. | |
~IpcMsgQueue () | |
Destructor. | |
void | postMsg (AbstractMessage *msg) |
this method pushes a notification into the queue | |
AbstractMessage * | consumeMsg () |
This method waits for the next message in the queue, retrieves the message and then consumes the message by resetting the message pointer. | |
void | purge () |
This method deletes all remaining messages in the queue. | |
uint32_t | getCurrentMsgCount () |
returns the present size of the Message Queue | |
Private Member Functions | |
void | checkSystemMaxValues (uint32_t queuelength) |
checks, if the system supports all FESA3 needs | |
IpcMsgQueue (const IpcMsgQueue &) | |
copy constructor. Private, to forbid usage. | |
IpcMsgQueue & | operator= (const IpcMsgQueue &) |
operator= Private, to forbid usage. | |
Private Attributes | |
mqd_t | msgQueue_ |
The message queue itself. |
If the RT and the server part are NOT in the same process, the POSIX message queue is used. The class provides the structure of the POSIX message queue and its corresponding functions.
Definition at line 19 of file IpcMsgQueue.h.
fesa::IpcMsgQueue::IpcMsgQueue | ( | const std::string & | name, | |
uint32_t | queuelength, | |||
bool | blocking | |||
) |
Constructor.
name | name of message queue | |
queuelength | length of queue |
FesaException | if message queue cannot be created because of missing root rights |
Definition at line 29 of file IpcMsgQueue.cpp.
References checkSystemMaxValues(), FesaErrorCreatingMsgQueue, fesa::MSG_DATA_SIZE_MAX, and msgQueue_.
fesa::IpcMsgQueue::~IpcMsgQueue | ( | ) |
Destructor.
Definition at line 57 of file IpcMsgQueue.cpp.
References fesa::AbstractMsgQueue::getQueueName(), and msgQueue_.
fesa::IpcMsgQueue::IpcMsgQueue | ( | const IpcMsgQueue & | ) | [private] |
copy constructor. Private, to forbid usage.
void fesa::IpcMsgQueue::checkSystemMaxValues | ( | uint32_t | queuelength | ) | [private] |
checks, if the system supports all FESA3 needs
queuelength | The length which is to check |
FesaException |
Definition at line 167 of file IpcMsgQueue.cpp.
References fesa::AbstractMsgQueue::constants_, FesaErrorMsgQueueGeneric, FesaErrorSystemMessageSizeExceeded, FesaErrorSystemQueueLengtExceeded, fesa::MSG_DATA_SIZE_MAX, and fesa::AbstractMsgQueue::Constants::msg_size_max_.
Referenced by IpcMsgQueue().
AbstractMessage * fesa::IpcMsgQueue::consumeMsg | ( | ) | [virtual] |
This method waits for the next message in the queue, retrieves the message and then consumes the message by resetting the message pointer.
FesaException |
Implements fesa::AbstractMsgQueue.
Definition at line 85 of file IpcMsgQueue.cpp.
References fesa::AutomaticNotificationMsg, fesa::CommandMsg, FesaErrorMsgQueueGeneric, FesaErrorUnknownMessageType, fesa::AbstractMsgQueue::getQueueName(), fesa::ManualNotificationMsg, fesa::MSG_DATA_SIZE_MAX, msgQueue_, and fesa::OnDemandMsg.
uint32_t fesa::IpcMsgQueue::getCurrentMsgCount | ( | ) | [virtual] |
returns the present size of the Message Queue
FesaException |
Implements fesa::AbstractMsgQueue.
Definition at line 141 of file IpcMsgQueue.cpp.
References FesaErrorMsgQueueGeneric, fesa::AbstractMsgQueue::getQueueName(), and msgQueue_.
Referenced by purge().
IpcMsgQueue& fesa::IpcMsgQueue::operator= | ( | const IpcMsgQueue & | ) | [private] |
operator= Private, to forbid usage.
Reimplemented from fesa::AbstractMsgQueue.
void fesa::IpcMsgQueue::postMsg | ( | AbstractMessage * | msg | ) | [virtual] |
this method pushes a notification into the queue
msg | notification message implemented as boost::shared_ptr |
FesaException | if message queue length is exceeded |
Implements fesa::AbstractMsgQueue.
Definition at line 63 of file IpcMsgQueue.cpp.
References FesaErrorMsgQueueGeneric, FesaErrorQueueLengthExceeded, fesa::AbstractMsgQueue::getQueueName(), fesa::MSG_DATA_SIZE_MAX, msgQueue_, fesa::AbstractMessage::prio_, and fesa::AbstractMessage::serialize().
void fesa::IpcMsgQueue::purge | ( | ) | [virtual] |
This method deletes all remaining messages in the queue.
FesaException |
Implements fesa::AbstractMsgQueue.
Definition at line 154 of file IpcMsgQueue.cpp.
References fesa::AbstractMsgQueue::constants_, FesaErrorMsgQueueGeneric, getCurrentMsgCount(), fesa::AbstractMsgQueue::getQueueName(), fesa::AbstractMsgQueue::Constants::msg_size_max_, and msgQueue_.
mqd_t fesa::IpcMsgQueue::msgQueue_ [private] |
The message queue itself.
Definition at line 68 of file IpcMsgQueue.h.
Referenced by consumeMsg(), getCurrentMsgCount(), IpcMsgQueue(), postMsg(), purge(), and ~IpcMsgQueue().