RTI Connext Modern C++ API
Version 6.1.2
|
<<extension>> Compression Settings More...
#include <rti/core/PolicySettings.hpp>
Public Member Functions | |
CompressionSettings () | |
Creates an instance with default, compression_ids, writer_compression_level and writer_compression_threshold. More... | |
CompressionSettings (const rti::core::CompressionIdMask compression_ids) | |
Creates an instance with the given compression_ids. More... | |
CompressionSettings (const rti::core::CompressionIdMask compression_ids, const uint32_t writer_compression_level, const int32_t writer_compression_threshold) | |
Creates an instance with the given compression_ids, writer_compression_level and writer_compression_threshold. More... | |
rti::core::CompressionIdMask | compression_ids () const |
Getter for compression_ids. More... | |
CompressionSettings | compression_ids (rti::core::CompressionIdMask compression_ids) |
Setter for compression_ids. More... | |
uint32_t | writer_compression_level () const |
Getter for writer_compression_level. More... | |
CompressionSettings | writer_compression_level (uint32_t writer_compression_level) |
Setter for writer_compression_level. More... | |
int32_t | writer_compression_threshold () const |
Getter for writer_compression_threshold. More... | |
CompressionSettings | writer_compression_threshold (int32_t writer_compression_threshold) |
Setter for writer_compression_threshold. More... | |
Static Public Member Functions | |
static uint32_t | compression_level_default () |
Return the default value for the compression level. More... | |
static uint32_t | compression_level_best_compression () |
Get the compression level that can be used to achieve the best compression ratio. More... | |
static uint32_t | compression_level_best_speed () |
Get the compression level that can be used to achieve the best compression speed. More... | |
<<extension>> Compression Settings
|
inline |
Creates an instance with default, compression_ids, writer_compression_level and writer_compression_threshold.
|
inlineexplicit |
Creates an instance with the given compression_ids.
|
inline |
Creates an instance with the given compression_ids, writer_compression_level and writer_compression_threshold.
References compression_level_default().
|
inlinestatic |
Return the default value for the compression level.
Referenced by CompressionSettings().
|
inlinestatic |
Get the compression level that can be used to achieve the best compression ratio.
|
inlinestatic |
Get the compression level that can be used to achieve the best compression speed.
|
inline |
Getter for compression_ids.
|
inline |
Setter for compression_ids.
A bitmap that represents the compression algorithm IDs (rti::core::CompressionIdMask) that are supported by the endpoint. The dds::pub::DataWriter creation will fail if more than one algorithm is provided.
If a dds::pub::DataWriter inherits multiple compression IDs from a dds::topic::Topic, only the least significant bit enabled will be inherited. This forces the following order of preference: rti::core::CompressionIdMask::zlib(), rti::core::CompressionIdMask::bzip2(), rti::core::CompressionIdMask::lz4().
Interactions with Security and Batching: Currently, the only algorithm that is supported when compression and batching are enabled on the same dds::pub::DataWriter is rti::core::CompressionIdMask::zlib().
The combination of compression, batching and data protection is not supported. Please consider using RTPS protection instead of data protection if compression and batching are required. The reason behind this restriction is that when using batching, compression is applied to the entire batch, while data protection is applied to each of the batch samples individually. Compressing already encrypted data results in an expansion of the data instead of a reduction of it because encrypted data does not lend itself to compression. Therefore this combination is not supported and will result in a DataWriter creation error.
Note: When rti::core::policy::DataWriterProtocol::serialize_key_with_dispose is enabled and a dispose message is sent, the serialized key is not compressed.
[default] For dds::topic::Topic, dds::pub::DataWriter a rti::core::CompressionIdMask mask set to rti::core::CompressionIdMask::none()
[default] For dds::sub::DataReader a rti::core::CompressionIdMask mask set to rti::core::CompressionIdMask::all().
|
inline |
Getter for writer_compression_level.
|
inline |
Setter for writer_compression_level.
Compression algorithms typically allow you to choose a level with which to compress the data. Each level has trade-offs between the resulting compression ratio and the speed of compression.
[range] [0, 10]
The value 1 represents the fastest compression time and the lowest compression ratio. The value 10 represents the slowest compression time but the highest compression ratio.
A value of 0 disables compression.
[default] rti::core::CompressionSettings::compression_level_best_compression()
|
inline |
Getter for writer_compression_threshold.
|
inline |
Setter for writer_compression_threshold.
Any sample with a serialized size greater than or equal to the threshold will be eligible to be compressed. All samples with an eligible serialized size will be compressed. Only if the compressed size is smaller than the serialized size will the sample be stored and sent compressed on the wire.
For batching we check the maximum serialized size of the batch, calculated as serialized_sample_max_size * rti::core::policy::Batch::max_samples
[range] [0, 2147483647] or dds::core::LENGTH_UNLIMITED
Setting the threshold to dds::core::LENGTH_UNLIMITED disables the compression.
[default] rti::core::CompressionSettings::compression_threshold_default() (8192)