|
Cute Chess
0.1
|
A class for creating objects based on the class' runtime name or key (a string). More...
#include <classregistry.h>
Public Types | |
| typedef T *(* | Factory) (void) |
Public Member Functions | |
| void | add (Factory f, const QString &key) |
| T * | create (const QString &key) |
| const QMap< QString, Factory > & | items () const |
Static Public Member Functions | |
| template<class Subclass > | |
| static T * | factory () |
A class for creating objects based on the class' runtime name or key (a string).
The created objects of a registry must have the same base class.
| typedef T*(* ClassRegistry< T >::Factory) (void) |
Typedef to the factory function.
|
inline |
Adds a new factory associated with key.
|
inline |
Creates and returns an object whose type is associated with key.
Returns 0 if there is no type that matches key.
Factory function for creating an object of type Subclass, which must be a subclass of T.
|
inline |
Returns a list of factory functions.
1.8.11