Main MRPT website > C++ reference for MRPT 1.5.9
List of all members | Public Member Functions | Protected Attributes | Private Member Functions
xsens::Cmt2f Class Reference

Detailed Description

The mid-level file communication class.

The class uses CMT level 1, but does not inherit from it. If software needs to access the level 1 component, it needs to be done through the getCmt1f() function.

Definition at line 165 of file cmt2.h.

#include <xSens_MT3/cmt2.h>

Public Member Functions

 Cmt2f ()
 Default constructor. More...
 
 ~Cmt2f ()
 Destructor. More...
 
XsensResultValue close (void)
 Close the file. More...
 
XsensResultValue closeAndDelete (void)
 Close the file and delete it. More...
 
XsensResultValue create (const char *filename)
 Create a new file with level 2 header. More...
 
XsensResultValue create (const wchar_t *filename)
 Create a new file with level 2 header. More...
 
Cmt1fgetCmt1f (void)
 Get a reference to the embedded Cmt1f object. More...
 
XsensResultValue getLastResult (void) const
 Return the error code of the last operation. More...
 
XsensResultValue getName (char *filename) const
 Retrieve the filename that was last successfully opened. More...
 
XsensResultValue getName (wchar_t *filename) const
 Retrieve the filename that was last successfully opened. More...
 
bool isOpen (void) const
 Return whether the file is open or not. More...
 
XsensResultValue open (const char *filename, const bool readOnly=false)
 Open a file and read the header. More...
 
XsensResultValue open (const wchar_t *filename, const bool readOnly=false)
 Open a file and read the header. More...
 
XsensResultValue readMessage (Message *msg, const uint8_t msgId=0)
 Read the next message from the file, when msgId is non-zero, the first matching message will be returned. More...
 
CmtFilePos getFileSize (void)
 Get the current file size. More...
 
CmtFilePos getReadPosition (void)
 Get the current read position. More...
 
XsensResultValue setReadPosition (CmtFilePos pos)
 Set the read position to the given position. More...
 
XsensResultValue writeMessage (const Message *msg)
 Write a message to the end of the file. More...
 

Protected Attributes

Cmt1f m_cmt1f
 The Cmt1f object that is used for the low-level operations. More...
 
XsensResultValue m_lastResult
 The last result of an operation. More...
 
bool m_readOnly
 When set to true, the file is read-only and attempts to write to it will fail. More...
 

Private Member Functions

 Cmt2f (const Cmt2f &ref)
 This object cannot be copied, so this function is not implemented. More...
 

Constructor & Destructor Documentation

◆ Cmt2f() [1/2]

xsens::Cmt2f::Cmt2f ( const Cmt2f ref)
private

This object cannot be copied, so this function is not implemented.

◆ Cmt2f() [2/2]

xsens::Cmt2f::Cmt2f ( )

Default constructor.

Definition at line 586 of file cmt2.cpp.

References m_lastResult, m_readOnly, and XRV_OK.

◆ ~Cmt2f()

xsens::Cmt2f::~Cmt2f ( )

Destructor.

Definition at line 594 of file cmt2.cpp.

References close().

Member Function Documentation

◆ close()

XsensResultValue xsens::Cmt2f::close ( void  )

◆ closeAndDelete()

XsensResultValue xsens::Cmt2f::closeAndDelete ( void  )

Close the file and delete it.

Definition at line 615 of file cmt2.cpp.

References xsens::Cmt1f::closeAndDelete(), xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, XRV_NOFILEOPEN, and XRV_OK.

Referenced by xsens::Cmt3::closeLogFile(), and xsens::Cmt3::createLogFile().

◆ create() [1/2]

XsensResultValue xsens::Cmt2f::create ( const char *  filename)

◆ create() [2/2]

XsensResultValue xsens::Cmt2f::create ( const wchar_t *  filename)

◆ getCmt1f()

Cmt1f * xsens::Cmt2f::getCmt1f ( void  )

Get a reference to the embedded Cmt1f object.

Definition at line 673 of file cmt2.cpp.

References m_cmt1f.

◆ getFileSize()

CmtFilePos xsens::Cmt2f::getFileSize ( void  )

Get the current file size.

Definition at line 808 of file cmt2.cpp.

References xsens::Cmt1f::getFileSize(), and m_cmt1f.

Referenced by xsens::Cmt3::getLogFileSize().

◆ getLastResult()

XsensResultValue xsens::Cmt2f::getLastResult ( void  ) const

Return the error code of the last operation.

Definition at line 680 of file cmt2.cpp.

References m_lastResult.

◆ getName() [1/2]

XsensResultValue xsens::Cmt2f::getName ( char *  filename) const

Retrieve the filename that was last successfully opened.

Definition at line 687 of file cmt2.cpp.

References xsens::Cmt1f::getName(), m_cmt1f, and m_lastResult.

Referenced by xsens::Cmt3::getLogFileName(), and xsens::Cmt3::isLogFileOpen().

◆ getName() [2/2]

XsensResultValue xsens::Cmt2f::getName ( wchar_t *  filename) const

Retrieve the filename that was last successfully opened.

Definition at line 694 of file cmt2.cpp.

References xsens::Cmt1f::getName(), m_cmt1f, and m_lastResult.

◆ getReadPosition()

CmtFilePos xsens::Cmt2f::getReadPosition ( void  )

Get the current read position.

Definition at line 815 of file cmt2.cpp.

References xsens::Cmt1f::getReadPos(), and m_cmt1f.

Referenced by xsens::Cmt3::getLogFileReadPosition(), and xsens::Cmt3::peekLogMessageId().

◆ isOpen()

bool xsens::Cmt2f::isOpen ( void  ) const

◆ open() [1/2]

XsensResultValue xsens::Cmt2f::open ( const char *  filename,
const bool  readOnly = false 
)

Open a file and read the header.

Definition at line 708 of file cmt2.cpp.

References xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, xsens::Cmt1f::open(), and XRV_ALREADYOPEN.

Referenced by xsens::Cmt3::openLogFile().

◆ open() [2/2]

XsensResultValue xsens::Cmt2f::open ( const wchar_t *  filename,
const bool  readOnly = false 
)

Open a file and read the header.

Definition at line 719 of file cmt2.cpp.

References xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, xsens::Cmt1f::open(), and XRV_ALREADYOPEN.

◆ readMessage()

XsensResultValue xsens::Cmt2f::readMessage ( Message msg,
const uint8_t  msgId = 0 
)

◆ setReadPosition()

XsensResultValue xsens::Cmt2f::setReadPosition ( CmtFilePos  pos)

Set the read position to the given position.

Definition at line 822 of file cmt2.cpp.

References m_cmt1f, m_lastResult, and xsens::Cmt1f::setReadPos().

Referenced by xsens::Cmt3::peekLogMessageId(), and xsens::Cmt3::resetLogFileReadPos().

◆ writeMessage()

XsensResultValue xsens::Cmt2f::writeMessage ( const Message msg)

Member Data Documentation

◆ m_cmt1f

Cmt1f xsens::Cmt2f::m_cmt1f
protected

The Cmt1f object that is used for the low-level operations.

Definition at line 172 of file cmt2.h.

Referenced by close(), closeAndDelete(), create(), getCmt1f(), getFileSize(), getName(), getReadPosition(), isOpen(), open(), readMessage(), setReadPosition(), and writeMessage().

◆ m_lastResult

XsensResultValue xsens::Cmt2f::m_lastResult
mutableprotected

The last result of an operation.

Definition at line 174 of file cmt2.h.

Referenced by close(), closeAndDelete(), Cmt2f(), create(), getLastResult(), getName(), open(), readMessage(), setReadPosition(), and writeMessage().

◆ m_readOnly

bool xsens::Cmt2f::m_readOnly
protected

When set to true, the file is read-only and attempts to write to it will fail.

Definition at line 176 of file cmt2.h.

Referenced by close(), closeAndDelete(), Cmt2f(), create(), open(), and writeMessage().




Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020