Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
MessageQueueBase Class ReferenceDefines the interface for sending new shared memory regions between processes. More...
Inheritance diagram for MessageQueueBase:
Detailed DescriptionDefines the interface for sending new shared memory regions between processes. This base class holds all of the template-independent code to allow general operations on MessageQueues. The templated version of MessageQueue provides concrete implementation, which is what you would instantiate. Each message entails its own shared memory region, as compared to SharedQueue, where a single large buffer is maintained, and all messages are copied into the common buffer. This class is better for large regions since it can avoid copying data around.
Definition at line 32 of file MessageQueue.h.
Member Typedef Documentation
a typedef to make it easier to obtain a lock on the queue for the extent of a scope Definition at line 128 of file MessageQueue.h.
The storage type for message entry indicies. This index is to be used with accessor functions, but may be recycled for a new message after all receivers have read the previous message. If you wish to have a unique message identifier, see getMessageSN() Definition at line 60 of file MessageQueue.h. Member Enumeration Documentationan enumerations of policies for dealing with overflow, pass to setOverflowPolicy()
Definition at line 140 of file MessageQueue.h. Constructor & Destructor Documentation
constructor Definition at line 45 of file MessageQueue.h.
destructor Definition at line 53 of file MessageQueue.h.
this shouldn't be called... Member Function Documentation
once called, any messages put into the queue must pass through filter first (note: there can only be one filter per process!) if a filter was previously registered, it is replaced with the new filter Definition at line 158 of file MessageQueue.h.
registers a semaphore which should be raised whenever a message is marked read The number of these are limited to the MAX_SENDERS template parameter of MessageQueue... returns false if too many are already registered You probably don't want to call this directly, use a MessageQueueStatusThread Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >. Referenced by MessageQueueStatusThread::addStatusListener().
add one to the receiver reference count Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >. Referenced by MessageReceiver::launched(), and MessageReceiver::MessageReceiver().
do not allow any new messages to be posted Definition at line 107 of file MessageQueue.h.
returns a reference to the queue's inter-process lock Definition at line 130 of file MessageQueue.h. Referenced by MessageReceiver::getNextMessage(), and MessageReceiver::peekNextMessage().
Each message gets a unique, monotonically increasing serial number; this function returns that number (MessageQueue::serialNumber). Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >. Referenced by MessageReceiver::findCurrentMessage(), MessageReceiver::getNextMessage(), MessageReceiver::markRead(), IPCEventTranslator::post(), and MessageReceiver::processNextMessage().
Checks to see how many messages have been processed (read by all receivers and removed from queue). Definition at line 119 of file MessageQueue.h. Referenced by MessageQueueStatusThread::addStatusListener(), getMessagesUnread(), IPCEventTranslator::post(), and MessageQueueStatusThread::run().
Returns the number of messages which have been sent. Definition at line 122 of file MessageQueue.h. Referenced by getMessagesUnread().
Returns the number of messages which have been sent but not yet read. Definition at line 125 of file MessageQueue.h.
return the receiver reference count Definition at line 68 of file MessageQueue.h.
returns the current overflow policy, see OverflowPolicy_t Definition at line 149 of file MessageQueue.h.
gets reportDroppings Definition at line 112 of file MessageQueue.h.
gets semgr Definition at line 154 of file MessageQueue.h. Referenced by MessageQueueStatusThread::addStatusListener(), MessageQueueStatusThread::cancelled(), MessageReceiver::finish(), MessageReceiver::launched(), MessageReceiver::markRead(), MessageReceiver::MessageReceiver(), MessageQueueStatusThread::run(), MessageReceiver::runloop(), MessageReceiver::stop(), MessageQueueStatusThread::stop(), MessageReceiver::waitNextMessage(), and MessageReceiver::~MessageReceiver().
returns true if it is the one-past-the-end of the queue Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >. Referenced by MessageReceiver::findCurrentMessage(), MessageReceiver::getNextMessage(), MessageReceiver::markRead(), and MessageReceiver::peekNextMessage().
increments read counter -- do not call more than once per receiver per message! Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >. Referenced by MessageReceiver::markRead(). return the next message in the queue (may or may not have been read by this process) Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >. Referenced by MessageReceiver::findCurrentMessage(), MessageReceiver::getNextMessage(), and MessageReceiver::markRead().
return most recent message added to the queue (may or may not have been read by this process) Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >. Referenced by MessageReceiver::findCurrentMessage(), and IPCEventTranslator::post(). return the previous message in the queue (may or may not have been read by this process) Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >. Referenced by MessageReceiver::findCurrentMessage().
return oldest message still in the queue (may or may not have been read by this process) Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >.
this shouldn't be called... request access to a particular message, does not mark message -- call as often as you like The caller inherits a reference to the returned region -- call removeReference when you are done with it Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >. Referenced by MessageReceiver::peekNextMessage().
request access to a particular message, increments read counter -- do not call more than once per receiver! The message is marked read and will be popped from the queue if all receivers have read the message as well. The caller inherits a reference to the returned region -- call removeReference when you are done with it Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >. Referenced by MessageReceiver::getNextMessage().
removes the current filter in place, if any Definition at line 162 of file MessageQueue.h.
removes a semaphore from the status listener list Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >. Referenced by MessageQueueStatusThread::cancelled().
remove one from the receiver reference count Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >. Referenced by MessageReceiver::finish(), and MessageReceiver::~MessageReceiver().
post a message into the queue -- a shared reference is added, the caller retains control current reference Thus, if you are sending a region and do not intend to use it again, either pass true for autoDereference or call RCRegion::removeReference() after sending to free the sender's memory. If no one dereferences the region, you can continue to access the region, even as the receiver accesses it as well. Thus if both sides retain references, you can use the region as a shared memory area for future communication. (beware of race conditions!) If rcr is NULL, an empty message will be sent (there's still some overhead to this -- may want to consider a semaphore instead of a MessageQueue if all you're going to do is 'ping' another process with empty messages) Implemented in MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >. Referenced by MotionManager::doAddMotion(), SoundManager::loadBuffer(), SoundManager::play(), IPCEventTranslator::post(), SoundManager::release(), MotionManager::removeMotion(), and SoundManager::resumePlay().
allows you to pick how to handle running out of space in the queue, see OverflowPolicy_t Definition at line 147 of file MessageQueue.h.
sets reportDroppings Definition at line 110 of file MessageQueue.h.
sets semgr Definition at line 152 of file MessageQueue.h. Member Data Documentation
provides storage of one message filter per process Definition at line 176 of file MessageQueue.h. Referenced by addMessageFilter(), MessageQueueBase(), removeMessageFilter(), and MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage().
if true, new messages will be rejected Definition at line 171 of file MessageQueue.h. Referenced by close(), and MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage().
a lock to grant serial access to the queue Definition at line 169 of file MessageQueue.h. Referenced by MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::addReadStatusListener(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::addReceiver(), close(), getLock(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::isEnd(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::markRead(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::newer(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::newest(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::older(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::oldest(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::readMessage(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::removeReadStatusListener(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::removeReceiver(), and MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage().
number of messages which have been read and removed from queue Definition at line 175 of file MessageQueue.h. Referenced by getMessagesRead(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::markRead(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::readMessage(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::removeReceiver(), and MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage().
number of messages which have been sent (serial number of next message) Definition at line 173 of file MessageQueue.h. Referenced by getMessagesSent(), and MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage().
how many receivers to expect Definition at line 174 of file MessageQueue.h. Referenced by MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::addReceiver(), getNumReceivers(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::markRead(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::readMessage(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::removeReceiver(), and MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage().
the choice of how to handle message overflow -- see OverflowPolicy_t Definition at line 170 of file MessageQueue.h. Referenced by getOverflowPolicy(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage(), and setOverflowPolicy().
if true, output will be sent on cerr when overflow occurs Definition at line 172 of file MessageQueue.h. Referenced by getReportDroppings(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage(), and setReportDroppings().
the global semaphore manager, needs to be set (once, globally) via setSemaphoreManager() before any receivers are added Definition at line 167 of file MessageQueue.h. Referenced by MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::addReadStatusListener(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::addReceiver(), getSemaphoreManager(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::markRead(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::readMessage(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::removeReadStatusListener(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::removeReceiver(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage(), and setSemaphoreManager(). The documentation for this class was generated from the following files: |
Tekkotsu v5.1CVS |
Generated Mon May 9 04:59:13 2016 by Doxygen 1.6.3 |