fesa::IpcMsgQueue Class Reference

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>

Inheritance diagram for fesa::IpcMsgQueue:
fesa::AbstractMsgQueue

List of all members.

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
AbstractMessageconsumeMsg ()
 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.
IpcMsgQueueoperator= (const IpcMsgQueue &)
 operator= Private, to forbid usage.

Private Attributes

mqd_t msgQueue_
 The message queue itself.

Detailed Description

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.


Constructor & Destructor Documentation

fesa::IpcMsgQueue::IpcMsgQueue ( const std::string &  name,
uint32_t  queuelength,
bool  blocking 
)

Constructor.

Parameters:
name name of message queue
queuelength length of queue
Exceptions:
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.


Member Function Documentation

void fesa::IpcMsgQueue::checkSystemMaxValues ( uint32_t  queuelength  )  [private]

checks, if the system supports all FESA3 needs

Parameters:
queuelength The length which is to check
Exceptions:
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.

Returns:
pointer to the consumed message
Exceptions:
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

Returns:
currentMessageCount
Exceptions:
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

Parameters:
msg notification message implemented as boost::shared_ptr
Exceptions:
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]

Member Data Documentation

The message queue itself.

Definition at line 68 of file IpcMsgQueue.h.

Referenced by consumeMsg(), getCurrentMsgCount(), IpcMsgQueue(), postMsg(), purge(), and ~IpcMsgQueue().


The documentation for this class was generated from the following files:

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1