A class for logging the mtb data. More...
#include <mtbdatalogger.h>

Public Member Functions | |
| void | close () override |
| Closes the file. More... | |
| void | close (bool deleteFile) |
| Closes and if requested deletes the file. More... | |
| bool | create (const XsString &filename) |
| Open a log file for output. More... | |
| XsString | filename () const |
| MtbDataLogger () | |
| Default constructor. More... | |
| bool | writeMessage (const XsMessage &message) override |
| Overloadable function to allow easier testing. More... | |
| bool | writeRaw (const XsByteArray &message) |
| Write precomposed raw data to the file stream. More... | |
| ~MtbDataLogger () override | |
Public Member Functions inherited from DataLogger | |
| DataLogger () | |
| virtual | ~DataLogger () |
Public Member Functions inherited from CallbackManagerXda | |
| 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 Attributes | |
| std::shared_ptr< IoInterfaceFile > | m_ioInterfaceFile |
| XsResultValue | m_lastResult |
A class for logging the mtb data.
Definition at line 73 of file mtbdatalogger.h.
| MtbDataLogger::MtbDataLogger | ( | ) |
Default constructor.
Definition at line 75 of file mtbdatalogger.cpp.
|
override |
Definition at line 80 of file mtbdatalogger.cpp.
|
overridevirtual |
| void MtbDataLogger::close | ( | bool | deleteFile | ) |
Closes and if requested deletes the file.
| deleteFile | If set to true then deletes the file |
Definition at line 141 of file mtbdatalogger.cpp.
| bool MtbDataLogger::create | ( | const XsString & | filename | ) |
Open a log file for output.
This function opens the supplied log file for writing.
| filename | The name of the file to open. It is recommended to use a fully qualified path+filename. |
Definition at line 98 of file mtbdatalogger.cpp.
| XsString MtbDataLogger::filename | ( | ) | const |
Definition at line 188 of file mtbdatalogger.cpp.
|
overridevirtual |
Overloadable function to allow easier testing.
Implements DataLogger.
Definition at line 156 of file mtbdatalogger.cpp.
| bool MtbDataLogger::writeRaw | ( | const XsByteArray & | message | ) |
Write precomposed raw data to the file stream.
Definition at line 174 of file mtbdatalogger.cpp.
|
private |
Definition at line 89 of file mtbdatalogger.h.
|
private |
Definition at line 88 of file mtbdatalogger.h.