11 char* source,
int size,
int max_size)
const
14 memcpy(source_copy, source, size);
17 "LZ4BufferFilter::encode: calling LZ4_compress_default(%d,%d).\n", size,
21 LZ4_compress_default(source_copy, (
char*)source, size, max_size);
25 "LZ4BufferFilter::encode: new_size=%d.\n", new_size);
29 return new_size > 0 ? new_size : 0;
33 char* source,
int size,
int max_size)
const
35 char* source_copy =
new char[buffer_size];
36 memcpy(source_copy, source, size);
39 "LZ4BufferFilter::decode: calling LZ4_decompress_safe(%d,%d).\n", size,
43 LZ4_decompress_safe(source_copy, (
char*)source, size, max_size);
47 "LZ4BufferFilter::decode: new_size=%d.\n", new_size);
51 return new_size > 0 ? new_size : 0;
#define madara_logger_ptr_log(loggering, level,...)
Fast version of the madara::logger::log method for Logger pointers.
virtual int decode(char *source, int size, int max_size) const
Decodes the buffer in place using LZ4 decompression.
virtual uint32_t get_version(void)
Gets the version of the filter.
int buffer_size
the size of the decompress buffer (max size)
virtual int encode(char *source, int size, int max_size) const
Encodes the buffer in place using LZ4 compression.
virtual std::string get_id(void)
Gets the id of the filter.
MADARA_EXPORT utility::Refcounter< logger::Logger > global_logger
uint32_t get_uint_version(const std::string &str_version)
Converts a string version to a uint32.