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>
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 AbstractMessage * | consumeMsg ()=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. | |
AbstractMsgQueue & | operator= (const AbstractMsgQueue &) |
operator= is private to forbid usage. |
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.
fesa::AbstractMsgQueue::AbstractMsgQueue | ( | const std::string & | name, | |
MQ_TYPE | type, | |||
uint32_t | queueLength | |||
) |
Constructor.
name | of message queue | |
type | of queue | |
queueLength | length of queue |
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.
void fesa::AbstractMsgQueue::checkState | ( | uint32_t | msgPrio | ) | [virtual] |
checks, if the queue is Full, or Almost Full, and throws an exeption, if so.
msgPrio | If the msgPrio is High, notify will work, even if the queue is almost full |
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
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
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
Definition at line 188 of file AbstractMsgQueue.h.
References queueLength_.
Referenced by fesa::MsgQueueFactory::getOrCreateMsgQueue().
const std::string & fesa::AbstractMsgQueue::getQueueName | ( | ) | [inline, virtual] |
this method returns the QueueName as string
Definition at line 183 of file AbstractMsgQueue.h.
References queueName_.
Referenced by fesa::IpcMsgQueue::consumeMsg(), fesa::IpcMsgQueue::getCurrentMsgCount(), fesa::OnDemandConsumerImpl::getMessage(), fesa::LocalMsgQueue::postMsg(), fesa::IpcMsgQueue::postMsg(), fesa::IpcMsgQueue::purge(), fesa::NotificationConsumer::run(), fesa::NotificationProducer::sendAutomaticNotification(), fesa::NotificationProducer::sendCommandMessage(), fesa::NotificationProducer::sendManualNotification(), fesa::OnDemandProducerImpl::sendMessage(), and fesa::IpcMsgQueue::~IpcMsgQueue().
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.
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.
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 method implemented in derived classes IpcMsgQueue and LocalMsgQueue
the | message to be putted on the queue |
FesaException |
Implemented in fesa::IpcMsgQueue, and fesa::LocalMsgQueue.
Referenced by fesa::NotificationProducer::sendAutomaticNotification(), fesa::NotificationProducer::sendCommandMessage(), fesa::NotificationProducer::sendManualNotification(), and fesa::OnDemandProducerImpl::sendMessage().
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().
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().
MQ_TYPE fesa::AbstractMsgQueue::queueType_ [protected] |
name of message queue
Definition at line 163 of file AbstractMsgQueue.h.