#include <HardwareCanSinkCanfile.h>
Public Types | |
typedef boost::shared_ptr< const HardwareCanSinkCanfile > | ConstPtr |
Const shared pointer shorthand. More... | |
typedef boost::shared_ptr< HardwareCanSinkCanfile > | Ptr |
Shared pointer shorthand. More... | |
Public Member Functions | |
HardwareCanSinkCanfile (const std::string &uri="HardwareCanSinkCanfile", const std::string &name="UnnamedHardwareCanSinkCanfile") | |
Constructor. More... | |
virtual void | set (const CanMessageStamped::Ptr &msg) |
virtual | ~HardwareCanSinkCanfile () |
Destructor. More... | |
Static Public Member Functions | |
static icl_sourcesink::URISchemeMap | supportedURISchemes () |
Protected Member Functions | |
bool | prepareFile () |
Opens the output file and writes the file header. More... | |
Private Attributes | |
boost::posix_time::time_duration | m_commit_timediff |
std::ofstream | m_data_file |
CAN data file stream. More... | |
boost::posix_time::ptime | m_last_commit_time |
Time at which the last message was committed to disk. More... | |
boost::posix_time::ptime | m_last_msg_time |
Timestamp of the last processed message. More... | |
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. More... | |
static const short | cMINOR_FILEVERSION = 2 |
Minor version number of the file format. More... | |
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.
|
virtual |
Destructor.
Definition at line 55 of file HardwareCanSinkCanfile.cpp.
|
protected |
Opens the output file and writes the file header.
Definition at line 58 of file HardwareCanSinkCanfile.cpp.
|
virtual |
Definition at line 96 of file HardwareCanSinkCanfile.cpp.
|
inlinestatic |
Definition at line 58 of file HardwareCanSinkCanfile.h.
|
staticprivate |
Major version number of the file format.
Definition at line 113 of file HardwareCanSinkCanfile.h.
|
staticprivate |
Minor version number of the file format.
Definition at line 115 of file HardwareCanSinkCanfile.h.
|
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.
|
private |
CAN data file stream.
Definition at line 92 of file HardwareCanSinkCanfile.h.
|
private |
Time at which the last message was committed to disk.
Definition at line 110 of file HardwareCanSinkCanfile.h.
|
private |
Timestamp of the last processed message.
Definition at line 108 of file HardwareCanSinkCanfile.h.
|
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.
|
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.