#include <bag.h>
Public Member Functions | |
Bag () | |
Bag (Bag &&other) | |
Bag (std::string const &filename, uint32_t mode=bagmode::Read) | |
Open a bag file. More... | |
void | close () |
Close the bag file. More... | |
uint32_t | getChunkThreshold () const |
Get the threshold for creating new chunks. More... | |
CompressionType | getCompression () const |
Get the compression method to use for writing chunks. More... | |
std::string | getFileName () const |
Get the filename of the bag. More... | |
uint32_t | getMajorVersion () const |
Get the major-version of the open bag file. More... | |
uint32_t | getMinorVersion () const |
Get the minor-version of the open bag file. More... | |
BagMode | getMode () const |
Get the mode the bag is in. More... | |
uint64_t | getSize () const |
Get the current size of the bag file (a lower bound) More... | |
bool | isOpen () const |
void | open (std::string const &filename, uint32_t mode=bagmode::Read) |
Open a bag file. More... | |
Bag & | operator= (Bag &&other) |
void | setChunkThreshold (uint32_t chunk_threshold) |
Set the threshold for creating new chunks. More... | |
void | setCompression (CompressionType compression) |
Set the compression method to use for writing chunks. More... | |
void | setEncryptorPlugin (const std::string &plugin_name, const std::string &plugin_param=std::string()) |
Set encryptor of the bag file. More... | |
void | swap (Bag &) |
template<class T > | |
void | write (std::string const &topic, ros::MessageEvent< T > const &event) |
Write a message into the bag file. More... | |
template<class T > | |
void | write (std::string const &topic, ros::Time const &time, boost::shared_ptr< T > const &msg, boost::shared_ptr< ros::M_string > connection_header=boost::shared_ptr< ros::M_string >()) |
Write a message into the bag file. More... | |
template<class T > | |
void | write (std::string const &topic, ros::Time const &time, boost::shared_ptr< T const > const &msg, boost::shared_ptr< ros::M_string > connection_header=boost::shared_ptr< ros::M_string >()) |
Write a message into the bag file. More... | |
template<class T > | |
void | write (std::string const &topic, ros::Time const &time, T const &msg, boost::shared_ptr< ros::M_string > connection_header=boost::shared_ptr< ros::M_string >()) |
Write a message into the bag file. More... | |
~Bag () | |
Private Member Functions | |
void | appendConnectionRecordToBuffer (Buffer &buf, ConnectionInfo const *connection_info) |
void | appendDataLengthToBuffer (Buffer &buf, uint32_t data_len) |
void | appendHeaderToBuffer (Buffer &buf, ros::M_string const &fields) |
Bag (const Bag &) | |
ros::M_string::const_iterator | checkField (ros::M_string const &fields, std::string const &field, unsigned int min_len, unsigned int max_len, bool required) const |
void | closeWrite () |
void | decompressBz2Chunk (ChunkHeader const &chunk_header) const |
void | decompressChunk (uint64_t chunk_pos) const |
void | decompressLz4Chunk (ChunkHeader const &chunk_header) const |
void | decompressRawChunk (ChunkHeader const &chunk_header) const |
template<class T > | |
void | doWrite (std::string const &topic, ros::Time const &time, T const &msg, boost::shared_ptr< ros::M_string > const &connection_header) |
uint32_t | getChunkOffset () const |
void | init () |
template<class T > | |
boost::shared_ptr< T > | instantiateBuffer (IndexEntry const &index_entry) const |
deserializes the message held in record_buffer_ More... | |
bool | isOp (ros::M_string &fields, uint8_t reqOp) const |
void | openAppend (std::string const &filename) |
void | openRead (std::string const &filename) |
void | openWrite (std::string const &filename) |
Bag & | operator= (const Bag &) |
void | read (char *b, std::streamsize n) const |
void | readChunkHeader (ChunkHeader &chunk_header) const |
void | readChunkInfoRecord () |
void | readConnectionIndexRecord200 () |
void | readConnectionRecord () |
bool | readDataLength (uint32_t &data_size) const |
bool | readField (ros::M_string const &fields, std::string const &field_name, bool required, ros::Time &data) const |
bool | readField (ros::M_string const &fields, std::string const &field_name, bool required, std::string &data) const |
template<typename T > | |
bool | readField (ros::M_string const &fields, std::string const &field_name, bool required, T *data) const |
bool | readField (ros::M_string const &fields, std::string const &field_name, unsigned int min_len, unsigned int max_len, bool required, std::string &data) const |
void | readFileHeaderRecord () |
bool | readHeader (ros::Header &header) const |
void | readHeaderFromBuffer (Buffer &buffer, uint32_t offset, ros::Header &header, uint32_t &data_size, uint32_t &bytes_read) const |
ros::Header | readMessageDataHeader (IndexEntry const &index_entry) |
void | readMessageDataHeaderFromBuffer (Buffer &buffer, uint32_t offset, ros::Header &header, uint32_t &data_size, uint32_t &bytes_read) const |
template<typename Stream > | |
void | readMessageDataIntoStream (IndexEntry const &index_entry, Stream &stream) const |
void | readMessageDataRecord102 (uint64_t offset, ros::Header &header) const |
uint32_t | readMessageDataSize (IndexEntry const &index_entry) const |
void | readMessageDefinitionRecord102 () |
void | readTopicIndexRecord102 () |
void | readVersion () |
void | seek (uint64_t pos, int origin=std::ios_base::beg) const |
void | startReadingVersion102 () |
void | startReadingVersion200 () |
void | startWriting () |
void | startWritingChunk (ros::Time time) |
void | stopWriting () |
void | stopWritingChunk () |
std::string | toHeaderString (ros::Time const *field) const |
template<typename T > | |
std::string | toHeaderString (T const *field) const |
void | write (char const *s, std::streamsize n) |
void | write (std::string const &s) |
void | writeChunkHeader (CompressionType compression, uint32_t compressed_size, uint32_t uncompressed_size) |
void | writeChunkInfoRecords () |
void | writeConnectionRecord (ConnectionInfo const *connection_info, const bool encrypt) |
void | writeConnectionRecords () |
void | writeDataLength (uint32_t data_len) |
void | writeFileHeaderRecord () |
void | writeHeader (ros::M_string const &fields) |
void | writeIndexRecords () |
template<class T > | |
void | writeMessageDataRecord (uint32_t conn_id, ros::Time const &time, T const &msg) |
void | writeVersion () |
Friends | |
class | MessageInstance |
class | View |
|
explicit |
Open a bag file.
filename | The bag file to open |
mode | The mode to use (either read, write or append) |
Can throw BagException
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
uint32_t rosbag::Bag::getChunkThreshold | ( | ) | const |
CompressionType rosbag::Bag::getCompression | ( | ) | const |
string rosbag::Bag::getFileName | ( | ) | const |
uint32_t rosbag::Bag::getMajorVersion | ( | ) | const |
uint32_t rosbag::Bag::getMinorVersion | ( | ) | const |
BagMode rosbag::Bag::getMode | ( | ) | const |
uint64_t rosbag::Bag::getSize | ( | ) | const |
|
private |
|
private |
void rosbag::Bag::open | ( | std::string const & | filename, |
uint32_t | mode = bagmode::Read |
||
) |
Open a bag file.
filename | The bag file to open |
mode | The mode to use (either read, write or append) |
Can throw BagException
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
void rosbag::Bag::setChunkThreshold | ( | uint32_t | chunk_threshold | ) |
void rosbag::Bag::setCompression | ( | CompressionType | compression | ) |
void rosbag::Bag::setEncryptorPlugin | ( | const std::string & | plugin_name, |
const std::string & | plugin_param = std::string() |
||
) |
Set encryptor of the bag file.
plugin_name | The name of the encryptor plugin |
plugin_param | The string parameter to be passed to the plugin initialization method |
Call this method to specify an encryptor for writing bag contents. This method need not be called when reading or appending a bag file: The encryptor is read from the bag file header.
|
private |
|
private |
|
private |
|
private |
|
private |
void rosbag::Bag::write | ( | std::string const & | topic, |
ros::MessageEvent< T > const & | event | ||
) |
Write a message into the bag file.
topic | The topic name |
event | The message event to be added |
Can throw BagIOException
void rosbag::Bag::write | ( | std::string const & | topic, |
ros::Time const & | time, | ||
boost::shared_ptr< T > const & | msg, | ||
boost::shared_ptr< ros::M_string > | connection_header = boost::shared_ptr<ros::M_string>() |
||
) |
Write a message into the bag file.
topic | The topic name |
time | Timestamp of the message |
msg | The message to be added |
connection_header | A connection header. |
Can throw BagIOException
void rosbag::Bag::write | ( | std::string const & | topic, |
ros::Time const & | time, | ||
boost::shared_ptr< T const > const & | msg, | ||
boost::shared_ptr< ros::M_string > | connection_header = boost::shared_ptr<ros::M_string>() |
||
) |
Write a message into the bag file.
topic | The topic name |
time | Timestamp of the message |
msg | The message to be added |
connection_header | A connection header. |
Can throw BagIOException
void rosbag::Bag::write | ( | std::string const & | topic, |
ros::Time const & | time, | ||
T const & | msg, | ||
boost::shared_ptr< ros::M_string > | connection_header = boost::shared_ptr<ros::M_string>() |
||
) |
Write a message into the bag file.
topic | The topic name |
time | Timestamp of the message |
msg | The message to be added |
connection_header | A connection header. |
Can throw BagIOException
|
private |
|
private |
|
private |
|
private |
|
private |
|
friend |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |
|
private |
|
mutableprivate |
|
mutableprivate |
|
private |