fesa::AbstractMsgQueue Class Reference

This class provides an abstract Message Queue. Whether the message queue will be implemented as IPC-Queue or as standard message queue depends on the deployment mode of the application (split, or shared). More...

#include <AbstractMsgQueue.h>

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

List of all members.

Classes

class  Constants
 constants, which are filled at runtime More...

Public Member Functions

 AbstractMsgQueue (const std::string &name, MQ_TYPE type, uint32_t queueLength)
 Constructor.
virtual ~AbstractMsgQueue ()
 Destructor.
virtual uint32_t isFull ()
 This method returns the number of messages if it is full or 0 if there is still space.
virtual uint32_t isAlmostFull ()
 This method returns the number of messages if it is almost full or 0 if there is still space.
virtual const std::string & getQueueName ()
 this method returns the QueueName as string
virtual uint32_t getQueueLength ()
 this method returns the QueueLength as uint32_t
virtual void postMsg (AbstractMessage *msg)=0
 virtual method implemented in derived classes IpcMsgQueue and LocalMsgQueue
virtual AbstractMessageconsumeMsg ()=0
 virtual method implemented in derived classes IpcMsgQueue and LocalMsgQueue
virtual void purge ()=0
 removes the message in the queue. Implemented by the concrete queue
virtual uint32_t getCurrentMsgCount ()=0
 number of messages in the queue. Implemented by the concrete queue
virtual void checkState (uint32_t msgPrio)
 checks, if the queue is Full, or Almost Full, and throws an exeption, if so.

Public Attributes

const Constants constants_
 message queue constants

Protected Attributes

std::string queueName_
 name of message queue
MQ_TYPE queueType_
 name of message queue
const uint32_t queueLength_
 queue capacity as number of messages

Private Member Functions

 AbstractMsgQueue (const AbstractMsgQueue &)
 Copy Constructor. Private, to forbid usage.
AbstractMsgQueueoperator= (const AbstractMsgQueue &)
 operator= is private to forbid usage.

Detailed Description

This class provides an abstract Message Queue. Whether the message queue will be implemented as IPC-Queue or as standard message queue depends on the deployment mode of the application (split, or shared).

Definition at line 37 of file AbstractMsgQueue.h.


Constructor & Destructor Documentation

fesa::AbstractMsgQueue::AbstractMsgQueue ( const std::string &  name,
MQ_TYPE  type,
uint32_t  queueLength 
)

Constructor.

Parameters:
name of message queue
type of queue
queueLength length of queue
Exceptions:
FesaException if length of message queue is exceeded

Definition at line 18 of file AbstractMsgQueue.cpp.

References constants_, FesaErrorQueueLengthExceeded, fesa::AbstractMsgQueue::Constants::msg_num_max_, queueLength_, and queueName_.

fesa::AbstractMsgQueue::~AbstractMsgQueue (  )  [virtual]

Destructor.

Definition at line 43 of file AbstractMsgQueue.cpp.

fesa::AbstractMsgQueue::AbstractMsgQueue ( const AbstractMsgQueue  )  [private]

Copy Constructor. Private, to forbid usage.


Member Function Documentation

void fesa::AbstractMsgQueue::checkState ( uint32_t  msgPrio  )  [virtual]

checks, if the queue is Full, or Almost Full, and throws an exeption, if so.

Parameters:
msgPrio If the msgPrio is High, notify will work, even if the queue is almost full
Exceptions:
FesaException 

Definition at line 61 of file AbstractMsgQueue.cpp.

References FesaErrorQueueFull, fesa::HIGH_MQ_PRIO, isAlmostFull(), isFull(), and queueName_.

Referenced by fesa::NotificationProducer::sendAutomaticNotification(), fesa::NotificationProducer::sendCommandMessage(), fesa::NotificationProducer::sendManualNotification(), and fesa::OnDemandProducerImpl::sendMessage().

virtual AbstractMessage* fesa::AbstractMsgQueue::consumeMsg (  )  [pure virtual]

virtual method implemented in derived classes IpcMsgQueue and LocalMsgQueue

Returns:
The consumed message
Exceptions:
FesaException 

Implemented in fesa::IpcMsgQueue, and fesa::LocalMsgQueue.

Referenced by fesa::OnDemandConsumerImpl::getMessage(), and fesa::NotificationConsumer::run().

virtual uint32_t fesa::AbstractMsgQueue::getCurrentMsgCount (  )  [pure virtual]

number of messages in the queue. Implemented by the concrete queue

Returns:
the number of messages on the queue

Implemented in fesa::IpcMsgQueue, and fesa::LocalMsgQueue.

Referenced by fesa::NotificationProducer::getCurrentMsgCount(), isAlmostFull(), and isFull().

uint32_t fesa::AbstractMsgQueue::getQueueLength (  )  [inline, virtual]

this method returns the QueueLength as uint32_t

Returns:
queueLength

Definition at line 188 of file AbstractMsgQueue.h.

References queueLength_.

Referenced by fesa::MsgQueueFactory::getOrCreateMsgQueue().

const std::string & fesa::AbstractMsgQueue::getQueueName (  )  [inline, virtual]
uint32_t fesa::AbstractMsgQueue::isAlmostFull (  )  [virtual]

This method returns the number of messages if it is almost full or 0 if there is still space.

Returns:
number of messages, if almost full, or 0 if space is left

Definition at line 47 of file AbstractMsgQueue.cpp.

References constants_, getCurrentMsgCount(), fesa::AbstractMsgQueue::Constants::queue_diag_slots, and queueLength_.

Referenced by checkState().

uint32_t fesa::AbstractMsgQueue::isFull (  )  [virtual]

This method returns the number of messages if it is full or 0 if there is still space.

Returns:
number of messages, if full, or 0 if space left

Definition at line 30 of file AbstractMsgQueue.cpp.

References getCurrentMsgCount(), and queueLength_.

Referenced by checkState().

AbstractMsgQueue& fesa::AbstractMsgQueue::operator= ( const AbstractMsgQueue  )  [private]

operator= is private to forbid usage.

Reimplemented in fesa::IpcMsgQueue, and fesa::LocalMsgQueue.

virtual void fesa::AbstractMsgQueue::postMsg ( AbstractMessage msg  )  [pure virtual]
virtual void fesa::AbstractMsgQueue::purge (  )  [pure virtual]

removes the message in the queue. Implemented by the concrete queue

Implemented in fesa::IpcMsgQueue, and fesa::LocalMsgQueue.

Referenced by fesa::OnDemandConsumerImpl::OnDemandConsumerImpl(), and fesa::NotificationConsumer::run().


Member Data Documentation

message queue constants

Definition at line 80 of file AbstractMsgQueue.h.

Referenced by AbstractMsgQueue(), fesa::IpcMsgQueue::checkSystemMaxValues(), isAlmostFull(), and fesa::IpcMsgQueue::purge().

const uint32_t fesa::AbstractMsgQueue::queueLength_ [protected]

queue capacity as number of messages

Definition at line 168 of file AbstractMsgQueue.h.

Referenced by AbstractMsgQueue(), getQueueLength(), isAlmostFull(), isFull(), and fesa::LocalMsgQueue::postMsg().

std::string fesa::AbstractMsgQueue::queueName_ [protected]

name of message queue

Definition at line 158 of file AbstractMsgQueue.h.

Referenced by AbstractMsgQueue(), checkState(), and getQueueName().

name of message queue

Definition at line 163 of file AbstractMsgQueue.h.


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

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1