Main MRPT website > C++ reference for MRPT 1.9.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 193 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 656 of file cmt2.cpp.

References m_lastResult, m_readOnly, and XRV_OK.

◆ ~Cmt2f()

xsens::Cmt2f::~Cmt2f ( )

Destructor.

Definition at line 664 of file cmt2.cpp.

References close().

Here is the call graph for this function:

Member Function Documentation

◆ close()

XsensResultValue xsens::Cmt2f::close ( void  )

Close the file.

Definition at line 667 of file cmt2.cpp.

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

Referenced by xsens::Cmt3::closeLogFile(), xsens::Cmt3::openLogFile(), ~Cmt2f(), and xsens::Cmt3::~Cmt3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ closeAndDelete()

XsensResultValue xsens::Cmt2f::closeAndDelete ( void  )

Close the file and delete it.

Definition at line 680 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [1/2]

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

Create a new file with level 2 header.

Definition at line 692 of file cmt2.cpp.

References xsens::Cmt1f::close(), xsens::Cmt1f::create(), xsens::Cmt1f::deleteData(), xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, xsens::Cmt1f::writeData(), XRV_ALREADYOPEN, and XRV_OK.

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [2/2]

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

Create a new file with level 2 header.

Definition at line 711 of file cmt2.cpp.

References xsens::Cmt1f::close(), xsens::Cmt1f::create(), xsens::Cmt1f::deleteData(), xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, xsens::Cmt1f::writeData(), XRV_ALREADYOPEN, and XRV_OK.

Here is the call graph for this function:

◆ getCmt1f()

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

Get a reference to the embedded Cmt1f object.

Definition at line 729 of file cmt2.cpp.

References m_cmt1f.

◆ getFileSize()

CmtFilePos xsens::Cmt2f::getFileSize ( void  )

Get the current file size.

Definition at line 855 of file cmt2.cpp.

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLastResult()

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

Return the error code of the last operation.

Definition at line 732 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 735 of file cmt2.cpp.

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getName() [2/2]

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

Retrieve the filename that was last successfully opened.

Definition at line 742 of file cmt2.cpp.

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

Here is the call graph for this function:

◆ getReadPosition()

CmtFilePos xsens::Cmt2f::getReadPosition ( void  )

Get the current read position.

Definition at line 858 of file cmt2.cpp.

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 752 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 762 of file cmt2.cpp.

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

Here is the call graph for this function:

◆ 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 861 of file cmt2.cpp.

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 201 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 203 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 207 of file cmt2.h.

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




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019