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
|
A two-way messaging communication channel that supports buffered message streams to multiple end points. More...
#include <ZMailbox.h>
Signals | |
void | mailslotCreated (const QString &owner, const QString &mailslot) |
Sent when a mail slot has been created. More... | |
void | mailslotRemoved (const QString &owner, const QString &mailslot) |
Sent when a mail slot has been removed. More... | |
Public Member Functions | |
ZMailbox (QObject *parent=0) | |
Q_INVOKABLE void | setOwnerName (const QString &name) |
Set the name of the mailbox owner. More... | |
Q_INVOKABLE const QString | getOwnerName () |
Get the name of the mailbox owner. More... | |
Q_INVOKABLE QObject * | mailslot (const QString &slotName) |
Returns the ZMailslot object for the named mailslot. More... | |
Q_INVOKABLE QObject * | createMailslot (const QString &mailslot) |
creates and returns the ZMailslot object for the named mailslot. More... | |
Q_INVOKABLE void | removeMailslot (const QString &mailslot) |
removes the ZMailslot object for the named mailslot from the Mailbox. More... | |
Q_INVOKABLE bool | hasMailslot (const QString &mailslot) |
Checks to see if a mailslot exists. More... | |
Q_INVOKABLE QStringList | getSlotNames () |
Returns an array containing the names of all mailslots in the mailbox. More... | |
Static Public Member Functions | |
static void | registerType () |
Register ZMailbox as a QML type. More... | |
Protected Attributes | |
zMailslotMap | m_slots |
Mail slots mapped by name. More... | |
QString | m_ownerName |
Name of the mailbox owner. More... | |
Private Types | |
typedef QMap< QString, ZMailslot * > | zMailslotMap |
A two-way messaging communication channel that supports buffered message streams to multiple end points.
The mailbox provides bidirectional communication between the mailslot owner and multiple named endpoints. Each endpoint communicates with the owner through its own mailslot object. Each mailslot supports two message queues - one each for sending and receiving messages with the endpoint.
ZMailbox, ZMailslot and ZMessageQueue are reentrant but not thread safe. The mailbox owner and the enpoints must all have the same thread affinity (ie. be in the same thread).
Definition at line 52 of file ZMailbox.h.
|
private |
Definition at line 56 of file ZMailbox.h.
|
explicit |
Definition at line 33 of file ZMailbox.cpp.
QObject * Zbl::ZMailbox::createMailslot | ( | const QString & | mailslot | ) |
creates and returns the ZMailslot object for the named mailslot.
Definition at line 59 of file ZMailbox.cpp.
const QString Zbl::ZMailbox::getOwnerName | ( | ) |
Get the name of the mailbox owner.
Definition at line 49 of file ZMailbox.cpp.
QStringList Zbl::ZMailbox::getSlotNames | ( | ) |
Returns an array containing the names of all mailslots in the mailbox.
Definition at line 94 of file ZMailbox.cpp.
bool Zbl::ZMailbox::hasMailslot | ( | const QString & | mailslot | ) |
Checks to see if a mailslot exists.
Definition at line 89 of file ZMailbox.cpp.
QObject * Zbl::ZMailbox::mailslot | ( | const QString & | slotName | ) |
Returns the ZMailslot object for the named mailslot.
Definition at line 54 of file ZMailbox.cpp.
|
signal |
Sent when a mail slot has been created.
Referenced by createMailslot().
|
signal |
Sent when a mail slot has been removed.
Referenced by removeMailslot().
|
static |
Register ZMailbox as a QML type.
Definition at line 38 of file ZMailbox.cpp.
Referenced by Zbl::Zblcore::registerTypes().
void Zbl::ZMailbox::removeMailslot | ( | const QString & | mailslot | ) |
removes the ZMailslot object for the named mailslot from the Mailbox.
The removed ZMailslot object will be deleted by calling deleteLater(). Issues the mailslotRemoved() signal.
Definition at line 75 of file ZMailbox.cpp.
void Zbl::ZMailbox::setOwnerName | ( | const QString & | name | ) |
Set the name of the mailbox owner.
Definition at line 44 of file ZMailbox.cpp.
|
protected |
Name of the mailbox owner.
Definition at line 141 of file ZMailbox.h.
Referenced by createMailslot(), getOwnerName(), removeMailslot(), and setOwnerName().
|
protected |
Mail slots mapped by name.
Definition at line 135 of file ZMailbox.h.
Referenced by createMailslot(), getSlotNames(), hasMailslot(), mailslot(), and removeMailslot().
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.