Public Member Functions | Private Attributes | List of all members
MtbDataLogger Class Reference

A class for logging the mtb data. More...

#include <mtbdatalogger.h>

Inheritance diagram for MtbDataLogger:
Inheritance graph
[legend]

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< IoInterfaceFilem_ioInterfaceFile
 
XsResultValue m_lastResult
 

Detailed Description

A class for logging the mtb data.

Definition at line 73 of file mtbdatalogger.h.

Constructor & Destructor Documentation

◆ MtbDataLogger()

MtbDataLogger::MtbDataLogger ( )

Default constructor.

Definition at line 75 of file mtbdatalogger.cpp.

◆ ~MtbDataLogger()

MtbDataLogger::~MtbDataLogger ( )
override

Definition at line 80 of file mtbdatalogger.cpp.

Member Function Documentation

◆ close() [1/2]

void MtbDataLogger::close ( )
overridevirtual

Closes the file.

Implements DataLogger.

Definition at line 133 of file mtbdatalogger.cpp.

◆ close() [2/2]

void MtbDataLogger::close ( bool  deleteFile)

Closes and if requested deletes the file.

Parameters
deleteFileIf set to true then deletes the file

Definition at line 141 of file mtbdatalogger.cpp.

◆ create()

bool MtbDataLogger::create ( const XsString filename)

Open a log file for output.

This function opens the supplied log file for writing.

Parameters
filenameThe name of the file to open. It is recommended to use a fully qualified path+filename.
Note
This function is only available in configuration mode.
Returns
True if successful
See also
close

Definition at line 98 of file mtbdatalogger.cpp.

◆ filename()

XsString MtbDataLogger::filename ( ) const
Returns
the filename of the file that we're logging to (if any)

Definition at line 188 of file mtbdatalogger.cpp.

◆ writeMessage()

bool MtbDataLogger::writeMessage ( const XsMessage message)
overridevirtual

Overloadable function to allow easier testing.

Implements DataLogger.

Definition at line 156 of file mtbdatalogger.cpp.

◆ writeRaw()

bool MtbDataLogger::writeRaw ( const XsByteArray message)

Write precomposed raw data to the file stream.

Definition at line 174 of file mtbdatalogger.cpp.

Member Data Documentation

◆ m_ioInterfaceFile

std::shared_ptr<IoInterfaceFile> MtbDataLogger::m_ioInterfaceFile
private

Definition at line 89 of file mtbdatalogger.h.

◆ m_lastResult

XsResultValue MtbDataLogger::m_lastResult
private

Definition at line 88 of file mtbdatalogger.h.


The documentation for this class was generated from the following files:


xsens_mti_driver
Author(s):
autogenerated on Sun Sep 3 2023 02:43:21