RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
Datacratic::Compressor Struct Reference
Inheritance diagram for Datacratic::Compressor:
Datacratic::GzipCompressor Datacratic::LzmaCompressor Datacratic::NullCompressor Datacratic::LzmaDecompressor

List of all members.

Public Types

enum  FlushLevel { FLUSH_NONE, FLUSH_AVAILABLE, FLUSH_SYNC, FLUSH_RESTART }
typedef std::function< size_t(const
char *data, size_t len) 
OnData )

Public Member Functions

virtual size_t compress (const char *data, size_t len, const OnData &onData)=0
virtual size_t flush (FlushLevel flushLevel, const OnData &onData)=0
virtual size_t finish (const OnData &onData)=0

Static Public Member Functions

static std::string filenameToCompression (const std::string &filename)
static Compressorcreate (const std::string &compression, int level)

Public Attributes

OnData onData

Detailed Description

Definition at line 30 of file compressor.h.


Member Enumeration Documentation

Flush levels.

Enumerator:
FLUSH_NONE 

No flushing of compressor.

FLUSH_AVAILABLE 

Flush all data would be available on decompression.

FLUSH_SYNC 

Flush so that we can find our point in the file.

FLUSH_RESTART 

Flush so we could restart the decompression here.

Definition at line 39 of file compressor.h.


Member Function Documentation

virtual size_t Datacratic::Compressor::compress ( const char *  data,
size_t  len,
const OnData &  onData 
) [pure virtual]

Compress the given data block, and write the result into the given buffer. Returns the number of output bytes written to consume the entire input buffer.

This will call onData zero or more times.

Implemented in Datacratic::LzmaCompressor, Datacratic::GzipCompressor, and Datacratic::NullCompressor.

Compressor * Datacratic::Compressor::create ( const std::string &  compression,
int  level 
) [static]

Create a compressor with the given scheme.

Definition at line 53 of file compressor.cc.

std::string Datacratic::Compressor::filenameToCompression ( const std::string &  filename) [static]

Convert a filename to a compression scheme.

Definition at line 40 of file compressor.cc.

virtual size_t Datacratic::Compressor::finish ( const OnData &  onData) [pure virtual]

Finish the stream... no more data can be written to it afterwards, and everything will be put into the compression

Implemented in Datacratic::LzmaCompressor, Datacratic::GzipCompressor, and Datacratic::NullCompressor.

virtual size_t Datacratic::Compressor::flush ( FlushLevel  flushLevel,
const OnData &  onData 
) [pure virtual]

Flush the stream at the given flush level. This will call onData zero or more times.

Implemented in Datacratic::LzmaCompressor, Datacratic::GzipCompressor, and Datacratic::NullCompressor.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator