Program Listing for File compression_options.hpp

Return to documentation for file (include/rosbag2_compression/compression_options.hpp)

// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef ROSBAG2_COMPRESSION__COMPRESSION_OPTIONS_HPP_
#define ROSBAG2_COMPRESSION__COMPRESSION_OPTIONS_HPP_

#include <cstdint>
#include <string>

#include "visibility_control.hpp"

namespace rosbag2_compression
{

enum class ROSBAG2_COMPRESSION_PUBLIC CompressionMode: uint32_t
{
  NONE = 0,
  FILE,
  MESSAGE,
  LAST_MODE = MESSAGE
};

ROSBAG2_COMPRESSION_PUBLIC CompressionMode compression_mode_from_string(
  const std::string & compression_mode);

ROSBAG2_COMPRESSION_PUBLIC std::string compression_mode_to_string(CompressionMode compression_mode);

struct CompressionOptions
{
  std::string compression_format{};
  CompressionMode compression_mode{CompressionMode::NONE};
  uint64_t compression_queue_size{0};
  uint64_t compression_threads{0};
};

}  // namespace rosbag2_compression
#endif  // ROSBAG2_COMPRESSION__COMPRESSION_OPTIONS_HPP_