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 
65 // Legacy header fields
66 static const std::string MD5_FIELD_NAME = "md5"; // <2.0
67 static const std::string TYPE_FIELD_NAME = "type"; // <2.0
68 static const std::string DEF_FIELD_NAME = "def"; // <2.0
69 static const std::string SEC_FIELD_NAME = "sec"; // <2.0
70 static const std::string NSEC_FIELD_NAME = "nsec"; // <2.0
71 static const std::string LATCHING_FIELD_NAME = "latching"; // <2.0
72 static const std::string CALLERID_FIELD_NAME = "callerid"; // <2.0
73 
74 // Current "op" field values
75 static const unsigned char OP_MSG_DATA = 0x02;
76 static const unsigned char OP_FILE_HEADER = 0x03;
77 static const unsigned char OP_INDEX_DATA = 0x04;
78 static const unsigned char OP_CHUNK = 0x05;
79 static const unsigned char OP_CHUNK_INFO = 0x06;
80 static const unsigned char OP_CONNECTION = 0x07;
81 
82 // Legacy "op" field values
83 static const unsigned char OP_MSG_DEF = 0x01;
84 
85 // Bytes reserved for file header record (4KB)
86 static const uint32_t FILE_HEADER_LENGTH = 4 * 1024;
87 
88 // Index data record version to write
89 static const uint32_t INDEX_VERSION = 1;
90 
91 // Chunk info record version to write
92 static const uint32_t CHUNK_INFO_VERSION = 1;
93 
94 // Compression types
95 static const std::string COMPRESSION_NONE = "none";
96 static const std::string COMPRESSION_BZ2 = "bz2";
97 static const std::string COMPRESSION_LZ4 = "lz4";
98 
99 } // namespace rosbag
100 
101 #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:127
rosbag::OP_CHUNK_INFO
static const unsigned char OP_CHUNK_INFO
Definition: constants.h:111
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:118
string
GLsizei const GLchar *const * string
Definition: glad/glad/glad.h:2861
rosbag::OP_MSG_DATA
static const unsigned char OP_MSG_DATA
Definition: constants.h:107
rosbag::INDEX_VERSION
static const uint32_t INDEX_VERSION
Definition: constants.h:121
rosbag::CHUNK_INFO_VERSION
static const uint32_t CHUNK_INFO_VERSION
Definition: constants.h:124
rosbag::OP_FILE_HEADER
static const unsigned char OP_FILE_HEADER
Definition: constants.h:108
rosbag::OP_CHUNK
static const unsigned char OP_CHUNK
Definition: constants.h:110
uint32_t
unsigned int uint32_t
Definition: stdint.h:80
rosbag::LATCHING_FIELD_NAME
static const std::string LATCHING_FIELD_NAME
Definition: constants.h:103
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:98
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:102
stdint.h
rosbag::DEF_FIELD_NAME
static const std::string DEF_FIELD_NAME
Definition: constants.h:100
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:101
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:99
rosbag
Definition: bag.h:61
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:129
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:115
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:104
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:112
rosbag::COMPRESSION_BZ2
static const std::string COMPRESSION_BZ2
Definition: constants.h:128
rosbag::OP_INDEX_DATA
static const unsigned char OP_INDEX_DATA
Definition: constants.h:109


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Fri Aug 2 2024 08:30:01