#include <widget_pool.hh>
Public Member Functions | |
| WidgetPool (QObject *parent=NULL) | |
| void | Add (const QString &name, int limit=-1) |
| bool | IsAvailable (const QString &name) |
| Widget * | Create (const QString &name) |
| bool | Take (const QString &name) |
| bool | Give (const QString &name) |
| QList< QString > | GetAvailableWidgets () |
Definition at line 45 of file widget_pool.hh.
| WidgetPool | ( | QObject * | parent = NULL |
) |
| void Add | ( | const QString & | name, | |
| int | limit = -1 | |||
| ) |
add a Widget to the WidgetPool This method adds a class to this widget pool. It does NOT add the given class to the WidgetRegistry. You should first add the class to the WidgetRegistry use the WidgetRegistry::RegisterWidgetFactory(WidgetFactory* factory) for this.
| name | full qualified class name. Is used to identify the class. | |
| limit | amount of available instances of the class in the WidgetRegistry. If unlimited then this can be set to -1. |
| Widget* Create | ( | const QString & | name | ) |
returns a instance of the given class name It does not WidgetPool::Take(const QString& name) a instance out of the pool. The user of this class is responsible to call the take method before calling this method.
| name | Full qualified class of the class of which you would like to have an instance. |
| QList<QString> GetAvailableWidgets | ( | ) |
Get a List with all available Widgets.
| bool Give | ( | const QString & | name | ) |
Returns a instance of a class into the pool This method returns one instance back into the pool. If there is an unlimited amount of instances of this class, nothing will be changed inside the pool.
| name | full qualified class of the class of which you give back an instance. |
| bool IsAvailable | ( | const QString & | name | ) |
returns whether this class has available instances or not
| name | Full qualified class of the class you would like to check |
| bool Take | ( | const QString & | name | ) |
Takes a instance of a class out of the pool This method takes one available instances out of the pool. If there are no available instances or unlimited amount of instances, nothing will be changed. Call this method always before creating an instance. If false is returned do not call WidgetPool::Create(const QString& name) !
| name | full qualified class of the class of which you would like to take an instance. |
1.5.8