----------------------------------------------------------------------------- Registers the message queue and listener with the messaging system. @param queue The name of the queue. Set to "" to destroy the queue. -----------------------------------------------------------------------------
| 134 | /// @param queue The name of the queue. Set to "" to destroy the queue. |
| 135 | //----------------------------------------------------------------------------- |
| 136 | void EventManager::setMessageQueue( const char* queue ) |
| 137 | { |
| 138 | // If a queue is already registered, unregister it. |
| 139 | if( mQueue && Dispatcher::isQueueRegistered( mQueue ) ) |
| 140 | { |
| 141 | unregisterAllEvents(); |
| 142 | Dispatcher::unregisterMessageListener( mQueue, &mListener ); |
| 143 | Dispatcher::unregisterMessageQueue( mQueue ); |
| 144 | } |
| 145 | |
| 146 | // Register the new queue. |
| 147 | if( queue && *queue ) |
| 148 | { |
| 149 | Dispatcher::registerMessageQueue( queue ); |
| 150 | Dispatcher::registerMessageListener( queue, &mListener ); |
| 151 | mQueue = StringTable->insert( queue ); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | //----------------------------------------------------------------------------- |
| 156 | /// Determines whether or not an event is registered with the EventManager. |
no test coverage detected