WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. | Zuble QML Types | Zuble C++ Classes | Zuble Overview |
Zuble
0.1
Zuble Framework C++/QML extension API
|
An object factory that creates new instances of objects defined by a Zuble sprocket. Used primarily to construct sprocket objects in Zuble background threads. More...
#include <ZblFactory.h>
Public Member Functions | |
ZblFactory (int importVersionMajor, int importVersionMinor, QObject *parent=0) | |
Object constructor. More... | |
QObject * | createObject (const char *qmlName) |
Locates the Sprocket object's constructor for the specified QML type and calls it, returning the resulting object. More... | |
int | importVersionMajor () |
returns the major import version number More... | |
int | importVersionMinor () |
returns the minor import version number More... | |
Protected Attributes | |
int | m_importVersionMajor |
major version number of the import More... | |
int | m_importVersionMinor |
minor version number of the import More... | |
sprocketObjectMap | m_objectFunctions |
Maps QML type names to appropriate version-specific Sprocket object constructors. More... | |
Friends | |
class | ZblCog |
An object factory that creates new instances of objects defined by a Zuble sprocket. Used primarily to construct sprocket objects in Zuble background threads.
A sprocket is a QML plugin that extends the Zuble core plugin. Sprockets implement the Zbl::ZblSprocket interface so javascript background threads can obtain instances of the objects they define. This is necessary because javascript background threads can't create objects using QQMLEngine.
ZblFactory mimics QQMLEngine's versioning semantics such that when an object of the import version is not available the highest version of the object that is less than the import version is created instead. Objects with version numbers higher than the import version are hidden.
ZblFactory objects are reentrant. Each ZblFactory object serves a single javascript background thread.
Definition at line 54 of file ZblFactory.h.
|
explicit |
Object constructor.
importVersionMajor | major version of the import |
importVersionMinor | minor version of the import |
parent | parent QObject or NULL if no object parent |
Definition at line 34 of file ZblFactory.cpp.
QObject * Zbl::ZblFactory::createObject | ( | const char * | qmlName | ) |
Locates the Sprocket object's constructor for the specified QML type and calls it, returning the resulting object.
qmlName | QML type name of the Sprocket object to construct |
Definition at line 45 of file ZblFactory.cpp.
|
inline |
returns the major import version number
Definition at line 86 of file ZblFactory.h.
|
inline |
returns the minor import version number
Definition at line 91 of file ZblFactory.h.
|
friend |
Definition at line 56 of file ZblFactory.h.
|
protected |
major version number of the import
Definition at line 104 of file ZblFactory.h.
Referenced by importVersionMajor().
|
protected |
minor version number of the import
Definition at line 110 of file ZblFactory.h.
Referenced by importVersionMinor().
|
protected |
Maps QML type names to appropriate version-specific Sprocket object constructors.
Definition at line 117 of file ZblFactory.h.
Referenced by Zbl::ZblCog::createFactory(), and createObject().
Zuble documentation copyright © 2019 Bob Dinitto. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Zuble is a derivative work of Qt version 5. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.