0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BlockCompressionCodecZlib.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
26 
27 #ifndef HYPERTABLE_BLOCKCOMPRESSIONCODECZLIB_H
28 #define HYPERTABLE_BLOCKCOMPRESSIONCODECZLIB_H
29 
31 
32 extern "C" {
33 #include <zlib.h>
34 }
35 
36 namespace Hypertable {
37 
40 
47 
48  public:
49  BlockCompressionCodecZlib(const Args &args);
51 
68  virtual void set_args(const Args &args);
69 
92  virtual void deflate(const DynamicBuffer &input, DynamicBuffer &output,
93  BlockHeader &header, size_t reserve=0);
94 
104  virtual void inflate(const DynamicBuffer &input, DynamicBuffer &output,
105  BlockHeader &header);
106 
111  virtual int get_type() { return ZLIB; }
112 
113  private:
114 
117 
120 
123 
126 
128  int m_level;
129  };
130 
132 
133 }
134 
135 #endif // HYPERTABLE_BLOCKCOMPRESSIONCODECZLIB_H
136 
bool m_deflate_initialized
Flag indicating that deflate state has been initialized.
bool m_inflate_initialized
Flag indicating that inflate state has been initialized.
virtual void deflate(const DynamicBuffer &input, DynamicBuffer &output, BlockHeader &header, size_t reserve=0)
Compresses a buffer using the ZLIB algorithm.
Declarations for BlockCompressionCodec.
virtual void inflate(const DynamicBuffer &input, DynamicBuffer &output, BlockHeader &header)
Decompresses a buffer compressed with the ZLIB algorithm.
A dynamic, resizable and reference counted memory buffer.
Definition: DynamicBuffer.h:42
std::vector< String > Args
Compression codec argument vector.
Block compressor that uses the ZLIB algorithm.
virtual int get_type()
Returns enum value representing compression type ZLIB.
virtual void set_args(const Args &args)
Sets arguments to control compression behavior.
Hypertable definitions
Base class for block headers.
Definition: BlockHeader.h:48
Abstract base class for block compression codecs.