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 buffered message stream with attached user-defined data cache. More...
#include <ZMailslot.h>
Signals | |
void | messageAvailable (QString slotName) |
Sent when a message has been placed into an endpoint's message queue. More... | |
void | responseAvailable (QString slotName) |
Sent when a response has been received from an endpoint. More... | |
Public Member Functions | |
ZMailslot (QObject *parent=0) | |
Q_INVOKABLE void | setSlotName (const QString &name) |
Set the name of the mailslot. More... | |
Q_INVOKABLE const QString | getSlotName () |
Get the name of the mailslot. More... | |
Q_INVOKABLE void | sendMessage (QVariant message) |
Enqueues message and sends messageAvailable signal immediately. More... | |
Q_INVOKABLE void | postMessage (QVariant message) |
Enqueues message immediately, then posts a defered messageAvailable signal to the event queue to be sent later. More... | |
Q_INVOKABLE int | messageCount () |
Returns the number of messages in the message queue. More... | |
Q_INVOKABLE QVariant | getMessage () |
Removes next message from message queue and returns it. More... | |
Q_INVOKABLE QVariant | peekMessage () |
Returns the next message from message queue without removing it from the queue. More... | |
Q_INVOKABLE void | sendResponse (QVariant response) |
Enqueues response and sends responseAvailable signal immediately. More... | |
Q_INVOKABLE void | postResponse (QVariant response) |
Enqueues response immediately, then queues a defered responseAvailable signal to be sent later. More... | |
Q_INVOKABLE int | responseCount () |
Returns the number of responses in the response queue. More... | |
Q_INVOKABLE QVariant | getResponse () |
Removes next response from response queue and returns it. More... | |
Q_INVOKABLE QVariant | peekResponse () |
Returns the next response from response queue without removing it from the queue. More... | |
Q_INVOKABLE QObject * | data () |
returns a ZMap dictionary object that can be used by mailslot client to store parameters. Use of the dictionary is user defined. More... | |
Static Public Member Functions | |
static void | registerType () |
Protected Attributes | |
ZBL_DECLARE_LOGGED_OBJECT QString | m_slotName |
Name of the mail slot. More... | |
ZMessageQueue | m_messageQueue |
Messages sent from mailslot owner to endpoint. More... | |
ZMessageQueue | m_responseQueue |
Responses sent from endpoint to mailslot owner. More... | |
ZMap * | m_data |
Mailslot owner's user-defined data dictionary. More... | |
Private Slots | |
void | onMessageQueueAvailable () |
void | onResponseQueueAvailable () |
A two-way buffered message stream with attached user-defined data cache.
The mailslot provides bidirectional communication between the mailslot owner and a single endpoint.
ZMailslot and ZMessageQueue are reentrant but not thread safe. The owners and enpoints must all have the same thread affinity (ie. be in the same thread).
Definition at line 50 of file ZMailslot.h.
|
explicit |
Definition at line 33 of file ZMailslot.cpp.
QObject * Zbl::ZMailslot::data | ( | ) |
returns a ZMap dictionary object that can be used by mailslot client to store parameters. Use of the dictionary is user defined.
Definition at line 131 of file ZMailslot.cpp.
QVariant Zbl::ZMailslot::getMessage | ( | ) |
Removes next message from message queue and returns it.
Definition at line 103 of file ZMailslot.cpp.
QVariant Zbl::ZMailslot::getResponse | ( | ) |
Removes next response from response queue and returns it.
Definition at line 84 of file ZMailslot.cpp.
const QString Zbl::ZMailslot::getSlotName | ( | ) |
Get the name of the mailslot.
Definition at line 60 of file ZMailslot.cpp.
|
signal |
Sent when a message has been placed into an endpoint's message queue.
Referenced by onMessageQueueAvailable().
int Zbl::ZMailslot::messageCount | ( | ) |
Returns the number of messages in the message queue.
Definition at line 98 of file ZMailslot.cpp.
|
privateslot |
Definition at line 138 of file ZMailslot.cpp.
Referenced by ZMailslot().
|
privateslot |
Definition at line 143 of file ZMailslot.cpp.
Referenced by ZMailslot().
QVariant Zbl::ZMailslot::peekMessage | ( | ) |
Returns the next message from message queue without removing it from the queue.
Definition at line 110 of file ZMailslot.cpp.
QVariant Zbl::ZMailslot::peekResponse | ( | ) |
Returns the next response from response queue without removing it from the queue.
Definition at line 91 of file ZMailslot.cpp.
void Zbl::ZMailslot::postMessage | ( | QVariant | message | ) |
Enqueues message immediately, then posts a defered messageAvailable signal to the event queue to be sent later.
Control returns to caller before messageAvailable signal is sent.
message |
Definition at line 72 of file ZMailslot.cpp.
void Zbl::ZMailslot::postResponse | ( | QVariant | response | ) |
Enqueues response immediately, then queues a defered responseAvailable signal to be sent later.
response |
Definition at line 124 of file ZMailslot.cpp.
|
static |
Definition at line 45 of file ZMailslot.cpp.
Referenced by Zbl::Zblcore::registerTypes().
|
signal |
Sent when a response has been received from an endpoint.
Referenced by onResponseQueueAvailable().
int Zbl::ZMailslot::responseCount | ( | ) |
Returns the number of responses in the response queue.
Definition at line 79 of file ZMailslot.cpp.
void Zbl::ZMailslot::sendMessage | ( | QVariant | message | ) |
Enqueues message and sends messageAvailable signal immediately.
Caller waits while signal is processed.
message |
Definition at line 65 of file ZMailslot.cpp.
void Zbl::ZMailslot::sendResponse | ( | QVariant | response | ) |
Enqueues response and sends responseAvailable signal immediately.
response |
Definition at line 117 of file ZMailslot.cpp.
void Zbl::ZMailslot::setSlotName | ( | const QString & | name | ) |
Set the name of the mailslot.
Definition at line 53 of file ZMailslot.cpp.
|
protected |
Mailslot owner's user-defined data dictionary.
Zuble will not add or remove objects from this map.
Definition at line 204 of file ZMailslot.h.
Referenced by data().
|
protected |
Messages sent from mailslot owner to endpoint.
Definition at line 190 of file ZMailslot.h.
Referenced by getMessage(), messageCount(), peekMessage(), postMessage(), and sendMessage().
|
protected |
Responses sent from endpoint to mailslot owner.
Definition at line 196 of file ZMailslot.h.
Referenced by getResponse(), peekResponse(), postResponse(), responseCount(), and sendResponse().
|
protected |
Name of the mail slot.
Definition at line 185 of file ZMailslot.h.
Referenced by data(), getMessage(), getResponse(), getSlotName(), onMessageQueueAvailable(), onResponseQueueAvailable(), peekMessage(), peekResponse(), postMessage(), postResponse(), sendMessage(), sendResponse(), and setSlotName().
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.