summaryrefslogtreecommitdiffstats
path: root/src/app/Queue/queue_mgr.cpp
blob: f7f0b27b4be69d7d7c3d79e92f9e5b8d0e061edd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "queue_mgr.h"

const TQString QueueManager::defaultName="default";
TQMap<TQString, Queue*> QueueManager::_queues;

QueueManager::QueueManager()
{
	Queue *defaultQ = new Queue(defaultName);
	_queues.insert(defaultQ->name(), defaultQ);
}

QueueManager::~QueueManager() 
{
	TQMap<TQString, Queue*>::iterator it;
 	for (it = _queues.begin(); it != _queues.end(); ++it )
 		delete it.data();
	_queues.clear();
}

Queue* QueueManager::queue(const TQString& queueName)
{
	if (!_queues.contains(queueName))
		return 0;
	return _queues[queueName];
}

TQValueList<TQString> QueueManager::queues() const
{
	return _queues.keys();
}