1 /***************************************************************************
3 * Copyright (C) 2006 David Brodsky *
5 * This library is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU Library General Public *
7 * License as published by the Free Software Foundation and appearing *
8 * in the file LICENSE.LGPL included in the packaging of this file. *
10 * This library is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13 * Library General Public License for more details. *
15 ***************************************************************************/
17 #ifndef _tairon_net_limit_limitmanager_h
18 #define _tairon_net_limit_limitmanager_h
32 /** \brief LimitManager handles list of limiters that are waiting for free
38 /** Creates a LimitManager object.
42 /** Destroys the manager.
46 /** Removes a limiter from the list.
48 void removeFromQueue(Limiter
*l
);
50 /** Returns pointer the instance of this class.
52 static LimitManager
*self() {
56 /** Adds a limiter to the list.
58 void wantMore(Limiter
*l
);
61 /** Called every second by a timer.
66 /** Pointer to the instance of this class.
68 static LimitManager
*limitmanager
;
74 /** List of limiters that are about to be deleted from the queue.
76 std::list
<Limiter
*> toDelete
;
78 /** List of waiting limiters.
80 std::set
<Limiter
*> waiting
;
85 }; // namespace Tairon
89 // vim: ai sw=4 ts=4 noet fdm=marker