constants.h
Go to the documentation of this file.
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2008, Willow Garage, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of Willow Garage, Inc. nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34 
35 #ifndef ROSBAG_CONSTANTS_H
36 #define ROSBAG_CONSTANTS_H
37 
38 #include <string>
39 #include <stdint.h>
40 
41 namespace rosbag {
42 
43 // Bag file version to write
44 static const std::string VERSION = "2.0";
45 
46 // Header field delimiter
47 static const unsigned char FIELD_DELIM = '=';
48 
49 // Current header fields
50 static const std::string OP_FIELD_NAME = "op";
51 static const std::string TOPIC_FIELD_NAME = "topic";
52 static const std::string VER_FIELD_NAME = "ver";
53 static const std::string COUNT_FIELD_NAME = "count";
54 static const std::string INDEX_POS_FIELD_NAME = "index_pos"; // 1.2+
55 static const std::string CONNECTION_COUNT_FIELD_NAME = "conn_count"; // 2.0+
56 static const std::string CHUNK_COUNT_FIELD_NAME = "chunk_count"; // 2.0+
57 static const std::string CONNECTION_FIELD_NAME = "conn"; // 2.0+
58 static const std::string COMPRESSION_FIELD_NAME = "compression"; // 2.0+
59 static const std::string SIZE_FIELD_NAME = "size"; // 2.0+
60 static const std::string TIME_FIELD_NAME = "time"; // 2.0+
61 static const std::string START_TIME_FIELD_NAME = "start_time"; // 2.0+
62 static const std::string END_TIME_FIELD_NAME = "end_time"; // 2.0+
63 static const std::string CHUNK_POS_FIELD_NAME = "chunk_pos"; // 2.0+
64 static const std::string ENCRYPTOR_FIELD_NAME = "encryptor"; // 2.0+
65 
66 // Legacy header fields
67 static const std::string MD5_FIELD_NAME = "md5"; // <2.0
68 static const std::string TYPE_FIELD_NAME = "type"; // <2.0
69 static const std::string DEF_FIELD_NAME = "def"; // <2.0
70 static const std::string SEC_FIELD_NAME = "sec"; // <2.0
71 static const std::string NSEC_FIELD_NAME = "nsec"; // <2.0
72 static const std::string LATCHING_FIELD_NAME = "latching"; // <2.0
73 static const std::string CALLERID_FIELD_NAME = "callerid"; // <2.0
74 
75 // Current "op" field values
76 static const unsigned char OP_MSG_DATA = 0x02;
77 static const unsigned char OP_FILE_HEADER = 0x03;
78 static const unsigned char OP_INDEX_DATA = 0x04;
79 static const unsigned char OP_CHUNK = 0x05;
80 static const unsigned char OP_CHUNK_INFO = 0x06;
81 static const unsigned char OP_CONNECTION = 0x07;
82 
83 // Legacy "op" field values
84 static const unsigned char OP_MSG_DEF = 0x01;
85 
86 // Bytes reserved for file header record (4KB)
87 static const uint32_t FILE_HEADER_LENGTH = 4 * 1024;
88 
89 // Index data record version to write
90 static const uint32_t INDEX_VERSION = 1;
91 
92 // Chunk info record version to write
93 static const uint32_t CHUNK_INFO_VERSION = 1;
94 
95 // Compression types
96 static const std::string COMPRESSION_NONE = "none";
97 static const std::string COMPRESSION_BZ2 = "bz2";
98 static const std::string COMPRESSION_LZ4 = "lz4";
99 
100 } // namespace rosbag
101 
102 #endif
rosbag::END_TIME_FIELD_NAME
static const std::string END_TIME_FIELD_NAME
Definition: constants.h:94
rosbag::COMPRESSION_NONE
static const std::string COMPRESSION_NONE
Definition: constants.h:128
rosbag::OP_CHUNK_INFO
static const unsigned char OP_CHUNK_INFO
Definition: constants.h:112
rosbag::FIELD_DELIM
static const unsigned char FIELD_DELIM
Definition: constants.h:79
rosbag::FILE_HEADER_LENGTH
static const uint32_t FILE_HEADER_LENGTH
Definition: constants.h:119
rosbag::OP_MSG_DATA
static const unsigned char OP_MSG_DATA
Definition: constants.h:108
rosbag::INDEX_VERSION
static const uint32_t INDEX_VERSION
Definition: constants.h:122
rosbag::ENCRYPTOR_FIELD_NAME
static const std::string ENCRYPTOR_FIELD_NAME
Definition: constants.h:96
rosbag::CHUNK_INFO_VERSION
static const uint32_t CHUNK_INFO_VERSION
Definition: constants.h:125
rosbag::OP_FILE_HEADER
static const unsigned char OP_FILE_HEADER
Definition: constants.h:109
rosbag::OP_CHUNK
static const unsigned char OP_CHUNK
Definition: constants.h:111
rosbag::LATCHING_FIELD_NAME
static const std::string LATCHING_FIELD_NAME
Definition: constants.h:104
rosbag::CONNECTION_FIELD_NAME
static const std::string CONNECTION_FIELD_NAME
Definition: constants.h:89
rosbag::MD5_FIELD_NAME
static const std::string MD5_FIELD_NAME
Definition: constants.h:99
rosbag::INDEX_POS_FIELD_NAME
static const std::string INDEX_POS_FIELD_NAME
Definition: constants.h:86
rosbag::START_TIME_FIELD_NAME
static const std::string START_TIME_FIELD_NAME
Definition: constants.h:93
rosbag::TOPIC_FIELD_NAME
static const std::string TOPIC_FIELD_NAME
Definition: constants.h:83
rosbag::NSEC_FIELD_NAME
static const std::string NSEC_FIELD_NAME
Definition: constants.h:103
rosbag::DEF_FIELD_NAME
static const std::string DEF_FIELD_NAME
Definition: constants.h:101
rosbag::CONNECTION_COUNT_FIELD_NAME
static const std::string CONNECTION_COUNT_FIELD_NAME
Definition: constants.h:87
rosbag::SEC_FIELD_NAME
static const std::string SEC_FIELD_NAME
Definition: constants.h:102
rosbag::VERSION
static const std::string VERSION
Definition: constants.h:76
rosbag::TIME_FIELD_NAME
static const std::string TIME_FIELD_NAME
Definition: constants.h:92
rosbag::CHUNK_POS_FIELD_NAME
static const std::string CHUNK_POS_FIELD_NAME
Definition: constants.h:95
rosbag::CHUNK_COUNT_FIELD_NAME
static const std::string CHUNK_COUNT_FIELD_NAME
Definition: constants.h:88
rosbag::TYPE_FIELD_NAME
static const std::string TYPE_FIELD_NAME
Definition: constants.h:100
rosbag
Definition: aes_encryptor.h:43
rosbag::VER_FIELD_NAME
static const std::string VER_FIELD_NAME
Definition: constants.h:84
rosbag::COMPRESSION_LZ4
static const std::string COMPRESSION_LZ4
Definition: constants.h:130
rosbag::COUNT_FIELD_NAME
static const std::string COUNT_FIELD_NAME
Definition: constants.h:85
rosbag::OP_MSG_DEF
static const unsigned char OP_MSG_DEF
Definition: constants.h:116
rosbag::OP_FIELD_NAME
static const std::string OP_FIELD_NAME
Definition: constants.h:82
rosbag::CALLERID_FIELD_NAME
static const std::string CALLERID_FIELD_NAME
Definition: constants.h:105
rosbag::COMPRESSION_FIELD_NAME
static const std::string COMPRESSION_FIELD_NAME
Definition: constants.h:90
rosbag::SIZE_FIELD_NAME
static const std::string SIZE_FIELD_NAME
Definition: constants.h:91
rosbag::OP_CONNECTION
static const unsigned char OP_CONNECTION
Definition: constants.h:113
rosbag::COMPRESSION_BZ2
static const std::string COMPRESSION_BZ2
Definition: constants.h:129
rosbag::OP_INDEX_DATA
static const unsigned char OP_INDEX_DATA
Definition: constants.h:110


rosbag_storage
Author(s): Dirk Thomas , Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:52