xsens::Cmt2f Class Reference

The mid-level file communication class. More...

#include <Robots/SeaBeeIII/IMUDataServer/cmt2.h>

Collaboration diagram for xsens::Cmt2f:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Cmt2f ()
 Default constructor.
 ~Cmt2f ()
 Destructor.
XsensResultValue close (void)
 Close the file.
XsensResultValue closeAndDelete (void)
 Close the file and delete it.
XsensResultValue create (const char *filename)
 Create a new file with level 2 header.
XsensResultValue create (const wchar_t *filename)
 Create a new file with level 2 header.
Cmt1fgetCmt1f (void)
 Get a reference to the embedded Cmt1f object.
XsensResultValue getLastResult (void) const
 Return the error code of the last operation.
XsensResultValue getName (char *filename) const
 Retrieve the filename that was last successfully opened.
XsensResultValue getName (wchar_t *filename) const
 Retrieve the filename that was last successfully opened.
bool isOpen (void) const
 Return whether the file is open or not.
XsensResultValue open (const char *filename, const bool readOnly=false)
 Open a file and read the header.
XsensResultValue open (const wchar_t *filename, const bool readOnly=false)
 Open a file and read the header.
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.
CmtFilePos getFileSize (void)
 Get the current file size.
CmtFilePos getReadPosition (void)
 Get the current read position.
XsensResultValue setReadPosition (CmtFilePos pos)
 Set the read position to the given position.
XsensResultValue writeMessage (const Message *msg)
 Write a message to the end of the file.

Protected Attributes

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

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 180 of file cmt2.h.


Constructor & Destructor Documentation

xsens::Cmt2f::Cmt2f (  ) 

Default constructor.

Definition at line 577 of file cmt2.cpp.

References m_lastResult, and m_readOnly.

xsens::Cmt2f::~Cmt2f (  ) 

Destructor.

Definition at line 585 of file cmt2.cpp.

References close().


Member Function Documentation

XsensResultValue xsens::Cmt2f::close ( void   ) 
XsensResultValue xsens::Cmt2f::closeAndDelete ( void   ) 

Close the file and delete it.

Definition at line 606 of file cmt2.cpp.

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

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

XsensResultValue xsens::Cmt2f::create ( const wchar_t *  filename  ) 
XsensResultValue xsens::Cmt2f::create ( const char *  filename  ) 
Cmt1f * xsens::Cmt2f::getCmt1f ( void   ) 

Get a reference to the embedded Cmt1f object.

Definition at line 664 of file cmt2.cpp.

References m_cmt1f.

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

CmtFilePos xsens::Cmt2f::getFileSize ( void   ) 

Get the current file size.

Definition at line 799 of file cmt2.cpp.

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

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

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

Return the error code of the last operation.

Definition at line 671 of file cmt2.cpp.

References m_lastResult.

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

Retrieve the filename that was last successfully opened.

Definition at line 685 of file cmt2.cpp.

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

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

Retrieve the filename that was last successfully opened.

Definition at line 678 of file cmt2.cpp.

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

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

CmtFilePos xsens::Cmt2f::getReadPosition ( void   ) 

Get the current read position.

Definition at line 806 of file cmt2.cpp.

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

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

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

Open a file and read the header.

Definition at line 710 of file cmt2.cpp.

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

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

Open a file and read the header.

Definition at line 699 of file cmt2.cpp.

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

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

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

Set the read position to the given position.

Definition at line 813 of file cmt2.cpp.

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

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

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

Member Data Documentation

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

Definition at line 187 of file cmt2.h.

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

XsensResultValue xsens::Cmt2f::m_lastResult [mutable, protected]

The last result of an operation.

Definition at line 189 of file cmt2.h.

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

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 191 of file cmt2.h.

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


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:44:46 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3