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

std::pair< Queue::shared_ptr,
bool > 
declare (const string &name, bool durable=false, bool autodelete=false, const OwnershipToken *const owner=0)
 Declare a queue.
void destroy (const string &name)
 Destroy the named queue.
template<class Test>
bool destroyIf (const string &name, Test test)
Queue::shared_ptr find (const string &name)
 Find the named queue.
string generateName ()
 Generate unique queue name.
void setStore (MessageStore *)
 Set the store to use.
MessageStoregetStore () const
 Return the message store used.
void setParent (management::Manageable *_parent)
 Register the manageable parent for declared queues.


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,
bool  autodelete = false,
const OwnershipToken *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.

void qpid::broker::QueueRegistry::setStore ( MessageStore  ) 

Set the store to use.

May only be called once.


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

Generated on Thu May 15 22:23:35 2008 for Qpid by  doxygen 1.5.5