qpid::broker::QueueRegistry Class Reference

A registry of queues indexed by queue name. More...

#include <QueueRegistry.h>

Collaboration diagram for qpid::broker::QueueRegistry:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 QueueRegistry (MessageStore *const store=0)
std::pair< Queue::shared_ptr,
bool > 
declare (const string &name, bool durable=false, uint32_t autodelete=0, const ConnectionToken *const owner=0)
 Declare a queue.
void destroy (const string &name)
 Destroy the named queue.
Queue::shared_ptr find (const string &name)
 Find the named queue.
string generateName ()
 Generate unique queue name.
MessageStore *const getStore () const
 Return the message store used.

Detailed Description

A registry of queues indexed by queue name.

Queues are reference counted using shared_ptr to ensure that they are deleted when and only when they are no longer in use.


Member Function Documentation

std::pair<Queue::shared_ptr, bool> qpid::broker::QueueRegistry::declare ( const string &  name,
bool  durable = false,
uint32_t  autodelete = 0,
const ConnectionToken *const   owner = 0 
)

Declare a queue.

Returns:
The queue and a boolean flag which is true if the queue was created by this declare call false if it already existed.

void qpid::broker::QueueRegistry::destroy ( const string &  name  ) 

Destroy the named queue.

Note: if the queue is in use it is not actually destroyed until all shared_ptrs to it are destroyed. During that time it is possible that a new queue with the same name may be created. This should not create any problems as the new and old queues exist independently. The registry has forgotten the old queue so there can be no confusion for subsequent calls to find or declare with the same name.

Queue::shared_ptr qpid::broker::QueueRegistry::find ( const string &  name  ) 

Find the named queue.

Return 0 if not found.


The documentation for this class was generated from the following file:
Generated on Tue Apr 17 14:22:15 2007 for Qpid by  doxygen 1.4.7