#include <HardwareCanSinkCanfile.h>
Public Types | |
typedef boost::shared_ptr < const HardwareCanSinkCanfile > | ConstPtr |
Const shared pointer shorthand. | |
typedef boost::shared_ptr < HardwareCanSinkCanfile > | Ptr |
Shared pointer shorthand. | |
Public Member Functions | |
HardwareCanSinkCanfile (const std::string &uri="HardwareCanSinkCanfile", const std::string &name="UnnamedHardwareCanSinkCanfile") | |
Constructor. | |
virtual void | set (const CanMessageStamped::Ptr &msg) |
virtual | ~HardwareCanSinkCanfile () |
Destructor. | |
Static Public Member Functions | |
static icl_sourcesink::URISchemeMap | supportedURISchemes () |
Protected Member Functions | |
bool | prepareFile () |
Opens the output file and writes the file header. | |
Private Attributes | |
boost::posix_time::time_duration | m_commit_timediff |
std::ofstream | m_data_file |
CAN data file stream. | |
boost::posix_time::ptime | m_last_commit_time |
Time at which the last message was committed to disk. | |
boost::posix_time::ptime | m_last_msg_time |
Timestamp of the last processed message. | |
std::vector < CanMessageStamped::ConstPtr > | m_msg_container |
std::size_t | m_msg_container_size |
Static Private Attributes | |
static const short | cMAJOR_FILEVERSION = 1 |
Major version number of the file format. | |
static const short | cMINOR_FILEVERSION = 2 |
Minor version number of the file format. |
This Sink writes CAN data in the FZI CAN file format (version 1), formatted as follows: timestamp msg_id dlc data[0] data[1] data[2] data[3] data[4] data[5] data[6] data[7] An example line is given below: 1302866616.057185 55 8 0 0 0 0 1b f5 21 7a
Definition at line 50 of file HardwareCanSinkCanfile.h.
typedef boost::shared_ptr<const HardwareCanSinkCanfile> icl_hardware::can::HardwareCanSinkCanfile::ConstPtr |
Const shared pointer shorthand.
Definition at line 56 of file HardwareCanSinkCanfile.h.
typedef boost::shared_ptr<HardwareCanSinkCanfile> icl_hardware::can::HardwareCanSinkCanfile::Ptr |
Shared pointer shorthand.
Definition at line 54 of file HardwareCanSinkCanfile.h.
icl_hardware::can::HardwareCanSinkCanfile::HardwareCanSinkCanfile | ( | const std::string & | uri = "HardwareCanSinkCanfile" , |
const std::string & | name = "UnnamedHardwareCanSinkCanfile" |
||
) |
Constructor.
Definition at line 37 of file HardwareCanSinkCanfile.cpp.
Destructor.
Definition at line 55 of file HardwareCanSinkCanfile.cpp.
bool icl_hardware::can::HardwareCanSinkCanfile::prepareFile | ( | ) | [protected] |
Opens the output file and writes the file header.
Definition at line 58 of file HardwareCanSinkCanfile.cpp.
void icl_hardware::can::HardwareCanSinkCanfile::set | ( | const CanMessageStamped::Ptr & | msg | ) | [virtual] |
Definition at line 96 of file HardwareCanSinkCanfile.cpp.
static icl_sourcesink::URISchemeMap icl_hardware::can::HardwareCanSinkCanfile::supportedURISchemes | ( | ) | [inline, static] |
Definition at line 58 of file HardwareCanSinkCanfile.h.
const short icl_hardware::can::HardwareCanSinkCanfile::cMAJOR_FILEVERSION = 1 [static, private] |
Major version number of the file format.
Definition at line 113 of file HardwareCanSinkCanfile.h.
const short icl_hardware::can::HardwareCanSinkCanfile::cMINOR_FILEVERSION = 2 [static, private] |
Minor version number of the file format.
Definition at line 115 of file HardwareCanSinkCanfile.h.
boost::posix_time::time_duration icl_hardware::can::HardwareCanSinkCanfile::m_commit_timediff [private] |
Maximum time difference between two commits. When this is reached, data is written out to disk.
Definition at line 105 of file HardwareCanSinkCanfile.h.
std::ofstream icl_hardware::can::HardwareCanSinkCanfile::m_data_file [private] |
CAN data file stream.
Definition at line 92 of file HardwareCanSinkCanfile.h.
boost::posix_time::ptime icl_hardware::can::HardwareCanSinkCanfile::m_last_commit_time [private] |
Time at which the last message was committed to disk.
Definition at line 110 of file HardwareCanSinkCanfile.h.
boost::posix_time::ptime icl_hardware::can::HardwareCanSinkCanfile::m_last_msg_time [private] |
Timestamp of the last processed message.
Definition at line 108 of file HardwareCanSinkCanfile.h.
std::vector<CanMessageStamped::ConstPtr> icl_hardware::can::HardwareCanSinkCanfile::m_msg_container [private] |
Message container which buffers data before writing it to disk, in order to reduce unnecessary disk accesses.
Definition at line 97 of file HardwareCanSinkCanfile.h.
std::size_t icl_hardware::can::HardwareCanSinkCanfile::m_msg_container_size [private] |
Maximum size of the message container. When this is reached, data is written out to disk.
Definition at line 101 of file HardwareCanSinkCanfile.h.