Class that delegates callbacks to registered XsCallbackHandlerItems. More...
#include <callbackmanagerxda.h>
Public Member Functions | |
void | addCallbackHandler (XsCallbackPlainC *cb, bool chain=true) |
Add a handler to the list. More... | |
void | addChainedManager (CallbackManagerXda *cm) |
Add a chained manager to the list. More... | |
CallbackManagerXda () | |
Constructor, initializes the callback list. More... | |
void | clearCallbackHandlers (bool chain=true) |
Clear the callback list. More... | |
void | clearChainedManagers () |
Clear the chained manager list. More... | |
void | copyCallbackHandlersFrom (CallbackManagerXda *cm, bool chain=true) |
Copy all handlers from cm into this manager. More... | |
void | copyCallbackHandlersTo (CallbackManagerXda *cm, bool chain=true) |
Copy all handlers from this manager into cm. More... | |
void | onAllBufferedDataAvailable (XsDevicePtrArray *devs, const XsDataPacketPtrArray *packets) override |
The XsCallback::onAllBufferedDataAvailable() callback forwarding function. More... | |
void | onAllDataAvailable (XsDevicePtrArray *devs, const XsDataPacketPtrArray *packets) override |
The XsCallback::onAllDataAvailable() callback forwarding function. More... | |
void | onAllLiveDataAvailable (XsDevicePtrArray *devs, const XsDataPacketPtrArray *packets) override |
The XsCallback::onAllLiveDataAvailable() callback forwarding function. More... | |
void | onAllRecordedDataAvailable (XsDevicePtrArray *devs, const XsDataPacketPtrArray *packets) override |
The XsCallback::onAllRecordedDataAvailable() callback forwarding function. More... | |
void | onBufferedDataAvailable (XsDevice *dev, const XsDataPacket *data) override |
The XsCallback::onBufferedDataAvailable() callback forwarding function. More... | |
void | onConnectivityChanged (XsDevice *dev, XsConnectivityState newState) override |
The XsCallback::onConnectivityChanged() callback forwarding function. More... | |
void | onDataAvailable (XsDevice *dev, const XsDataPacket *data) override |
The XsCallback::onDataAvailable() callback forwarding function. More... | |
void | onDataUnavailable (XsDevice *dev, int64_t packetId) override |
The XsCallback::onDataUnavailable() callback forwarding function. More... | |
void | onDeviceStateChanged (XsDevice *dev, XsDeviceState newState, XsDeviceState oldState) override |
The XsCallback::onDeviceStateChanged() callback forwarding function. More... | |
void | onError (XsDevice *dev, XsResultValue error) override |
The Xscallback::onError() callback forwarding function. More... | |
void | onInfoResponse (XsDevice *dev, XsInfoRequest request) override |
The XsCallback::onInfoResponse() callback forwarding function. More... | |
void | onLiveDataAvailable (XsDevice *dev, const XsDataPacket *packet) override |
The XsCallback::onLiveDataAvailable() callback forwarding function. More... | |
void | onMessageDetected (XsDevice *dev, XsProtocolType type, XsByteArray const *rawMessage) override |
The Xscallback::onMessageReceivedFromDevice() callback forwarding function. More... | |
void | onMessageReceivedFromDevice (XsDevice *dev, XsMessage const *message) override |
The Xscallback::onMessageReceivedFromDevice() callback forwarding function. More... | |
void | onMessageSentToDevice (XsDevice *dev, XsMessage const *message) override |
The Xscallback::onMessageSentToDevice() callback forwarding function. More... | |
void | onMissedPackets (XsDevice *dev, int count, int first, int last) override |
The XsCallback::onMissedPackets() callback forwarding function. More... | |
void | onNonDataMessage (XsDevice *dev, XsMessage const *message) override |
The Xscallback::onNonDataMessage() callback forwarding function. More... | |
void | onProgressUpdated (XsDevice *dev, int current, int total, const XsString *identifier) override |
The XsCallback::onProgressUpdated() callback forwarding function. More... | |
void | onRecordedDataAvailable (XsDevice *dev, const XsDataPacket *data) override |
The XsCallback::onRecordedDataAvailable() callback forwarding function. More... | |
void | onRestoreCommunication (const XsString *portName, XsResultValue result) override |
The Xscallback::onRestoreCommunication callback forwarding function. More... | |
void | onTransmissionRequest (int channelId, const XsByteArray *data) override |
void | onWakeupReceived (XsDevice *dev) override |
The XsCallback::onWakeupReceived() callback forwarding function. More... | |
int | onWriteMessageToLogFile (XsDevice *dev, const XsMessage *message) override |
The XsCallback::onWriteMessageToLogFile() callback forwarding function. More... | |
void | removeCallbackHandler (XsCallbackPlainC *cb, bool chain=true) |
Remove a handler from the list. More... | |
void | removeChainedManager (CallbackManagerXda *cm) |
Remove achained manager from the list. More... | |
~CallbackManagerXda () | |
Destructor, clears the callback list. More... | |
Private Member Functions | |
CallbackManagerXda (CallbackManagerXda const &)=delete | |
CallbackManagerXda const & | operator= (CallbackManagerXda const &)=delete |
Private Attributes | |
xsens::MutexReadWrite * | m_callbackMutex |
Administration mutex. More... | |
CallbackHandlerXdaItem * | m_handlerList |
The first item in the linked list of callback handlers. More... | |
CallbackManagerItem * | m_managerList |
The first item in the linked list of child callback managers. More... | |
Class that delegates callbacks to registered XsCallbackHandlerItems.
CallbackManagerXda is itself an XsCallback implementer. When a callback is triggered it walks through its linked list of registered callbacks and calls the appropriate function in each one.
Adding and removing handlers is done through the addXsCallbackHandlerItem() and removeXsCallbackHandlerItem() functions.
The callback handler can contain so called chained managers. A chained manager receives any callback handler add/remove request that is done to the parent. The chained managers do not automatically execute all callbacks that the parent manager executes. So chaining only affects callback administration, not callback execution.
Definition at line 78 of file callbackmanagerxda.h.
CallbackManagerXda::CallbackManagerXda | ( | ) |
Constructor, initializes the callback list.
Definition at line 103 of file callbackmanagerxda.cpp.
CallbackManagerXda::~CallbackManagerXda | ( | ) |
Destructor, clears the callback list.
Definition at line 112 of file callbackmanagerxda.cpp.
|
privatedelete |
void CallbackManagerXda::addCallbackHandler | ( | XsCallbackPlainC * | cb, |
bool | chain = true |
||
) |
Add a handler to the list.
cb | The handler to add to the list. |
chain | When set to true (default) the callback is added to chained managers as well |
Definition at line 158 of file callbackmanagerxda.cpp.
void CallbackManagerXda::addChainedManager | ( | CallbackManagerXda * | cm | ) |
Add a chained manager to the list.
cm | The manager to add to the list. |
Definition at line 262 of file callbackmanagerxda.cpp.
void CallbackManagerXda::clearCallbackHandlers | ( | bool | chain = true | ) |
Clear the callback list.
chain | If set to true clears all callback handlers |
Definition at line 129 of file callbackmanagerxda.cpp.
void CallbackManagerXda::clearChainedManagers | ( | ) |
Clear the chained manager list.
Definition at line 245 of file callbackmanagerxda.cpp.
void CallbackManagerXda::copyCallbackHandlersFrom | ( | CallbackManagerXda * | cm, |
bool | chain = true |
||
) |
Copy all handlers from cm into this manager.
cm | The CallbackManagerXda to copy the handlers from |
chain | Whether to propagate the added handlers to chained managers |
Definition at line 337 of file callbackmanagerxda.cpp.
void CallbackManagerXda::copyCallbackHandlersTo | ( | CallbackManagerXda * | cm, |
bool | chain = true |
||
) |
Copy all handlers from this manager into cm.
cm | The CallbackManagerXda to copy the handlers to |
chain | Whether to propagate the added handlers to chained managers |
Definition at line 328 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onAllBufferedDataAvailable() callback forwarding function.
Definition at line 469 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onAllDataAvailable() callback forwarding function.
Definition at line 586 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onAllLiveDataAvailable() callback forwarding function.
Definition at line 376 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onAllRecordedDataAvailable() callback forwarding function.
Definition at line 612 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onBufferedDataAvailable() callback forwarding function.
Definition at line 456 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onConnectivityChanged() callback forwarding function.
Definition at line 482 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onDataAvailable() callback forwarding function.
Definition at line 573 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onDataUnavailable() callback forwarding function.
Definition at line 402 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onDeviceStateChanged() callback forwarding function.
Definition at line 350 of file callbackmanagerxda.cpp.
|
override |
The Xscallback::onError() callback forwarding function.
Definition at line 508 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onInfoResponse() callback forwarding function.
Definition at line 495 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onLiveDataAvailable() callback forwarding function.
Definition at line 363 of file callbackmanagerxda.cpp.
|
override |
The Xscallback::onMessageReceivedFromDevice() callback forwarding function.
Definition at line 534 of file callbackmanagerxda.cpp.
|
override |
The Xscallback::onMessageReceivedFromDevice() callback forwarding function.
Definition at line 547 of file callbackmanagerxda.cpp.
|
override |
The Xscallback::onMessageSentToDevice() callback forwarding function.
Definition at line 560 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onMissedPackets() callback forwarding function.
Definition at line 389 of file callbackmanagerxda.cpp.
The Xscallback::onNonDataMessage() callback forwarding function.
Definition at line 521 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onProgressUpdated() callback forwarding function.
Definition at line 428 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onRecordedDataAvailable() callback forwarding function.
Definition at line 599 of file callbackmanagerxda.cpp.
|
override |
The Xscallback::onRestoreCommunication callback forwarding function.
Definition at line 637 of file callbackmanagerxda.cpp.
|
override |
Definition at line 624 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onWakeupReceived() callback forwarding function.
Definition at line 415 of file callbackmanagerxda.cpp.
|
override |
The XsCallback::onWriteMessageToLogFile() callback forwarding function.
Definition at line 441 of file callbackmanagerxda.cpp.
|
privatedelete |
void CallbackManagerXda::removeCallbackHandler | ( | XsCallbackPlainC * | cb, |
bool | chain = true |
||
) |
Remove a handler from the list.
cb | The handler to remove from the list. |
chain | When set to true (default) the callback is added to chained managers as well |
Definition at line 207 of file callbackmanagerxda.cpp.
void CallbackManagerXda::removeChainedManager | ( | CallbackManagerXda * | cm | ) |
Remove achained manager from the list.
cm | The manager to remove from the list. |
Definition at line 298 of file callbackmanagerxda.cpp.
|
private |
Administration mutex.
Definition at line 120 of file callbackmanagerxda.h.
|
private |
The first item in the linked list of callback handlers.
Definition at line 121 of file callbackmanagerxda.h.
|
private |
The first item in the linked list of child callback managers.
Definition at line 122 of file callbackmanagerxda.h.