C++ API Reference for Intel® Data Analytics Acceleration Library 2018 Update 1

zlibcompression.h
1 /* file: zlibcompression.h */
2 /*******************************************************************************
3 * Copyright 2014-2017 Intel Corporation
4 * All Rights Reserved.
5 *
6 * If this software was obtained under the Intel Simplified Software License,
7 * the following terms apply:
8 *
9 * The source code, information and material ("Material") contained herein is
10 * owned by Intel Corporation or its suppliers or licensors, and title to such
11 * Material remains with Intel Corporation or its suppliers or licensors. The
12 * Material contains proprietary information of Intel or its suppliers and
13 * licensors. The Material is protected by worldwide copyright laws and treaty
14 * provisions. No part of the Material may be used, copied, reproduced,
15 * modified, published, uploaded, posted, transmitted, distributed or disclosed
16 * in any way without Intel's prior express written permission. No license under
17 * any patent, copyright or other intellectual property rights in the Material
18 * is granted to or conferred upon you, either expressly, by implication,
19 * inducement, estoppel or otherwise. Any license under such intellectual
20 * property rights must be express and approved by Intel in writing.
21 *
22 * Unless otherwise agreed by Intel in writing, you may not remove or alter this
23 * notice or any other notice embedded in Materials by Intel or Intel's
24 * suppliers or licensors in any way.
25 *
26 *
27 * If this software was obtained under the Apache License, Version 2.0 (the
28 * "License"), the following terms apply:
29 *
30 * You may not use this file except in compliance with the License. You may
31 * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
32 *
33 *
34 * Unless required by applicable law or agreed to in writing, software
35 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
36 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37 *
38 * See the License for the specific language governing permissions and
39 * limitations under the License.
40 *******************************************************************************/
41 
42 /*
43 //++
44 // Implementation of the ZLIB DEFLATE compression and decompression interface.
45 //--
46 */
47 
48 #ifndef __ZLIBCOMPRESSION_H__
49 #define __ZLIBCOMPRESSION_H__
50 #include "data_management/compression/compression.h"
51 
52 namespace daal
53 {
54 namespace data_management
55 {
56 
57 namespace interface1
58 {
73 /* [ZlibCompressionParameter source code] */
74 class DAAL_EXPORT ZlibCompressionParameter : public data_management::CompressionParameter
75 {
76 public:
83  ZlibCompressionParameter( CompressionLevel clevel = defaultLevel, bool bgzHeader = false ) :
84  data_management::CompressionParameter( clevel ), gzHeader(bgzHeader) {}
85 
86  ~ZlibCompressionParameter() {}
87 
88  bool gzHeader;
89 };
90 /* [ZlibCompressionParameter source code] */
91 
102 template<> class DAAL_EXPORT Compressor<zlib> : public data_management::CompressorImpl
103 {
104 public:
108  Compressor();
109  ~Compressor();
116  void setInputDataBlock( byte *inBlock, size_t size, size_t offset );
121  void setInputDataBlock( DataBlock &inBlock )
122  {
123  setInputDataBlock( inBlock.getPtr(), inBlock.getSize(), 0 );
124  }
131  void run( byte *outBlock, size_t size, size_t offset );
136  void run( DataBlock &outBlock )
137  {
138  run( outBlock.getPtr(), outBlock.getSize(), 0 );
139  }
140 
141  ZlibCompressionParameter parameter;
143 protected:
144  void initialize();
145 
146 private:
147  void *_strmp;
148  int _flush;
149 
150  void finalizeCompression();
151  void resetCompression();
152 
153 };
154 
165 template<> class DAAL_EXPORT Decompressor<zlib> : public data_management::DecompressorImpl
166 {
167 public:
171  Decompressor();
172  ~Decompressor();
179  void setInputDataBlock( byte *inBlock, size_t size, size_t offset );
184  void setInputDataBlock( DataBlock &inBlock )
185  {
186  setInputDataBlock( inBlock.getPtr(), inBlock.getSize(), 0 );
187  }
194  void run( byte *outBlock, size_t size, size_t offset );
199  void run( DataBlock &outBlock )
200  {
201  run( outBlock.getPtr(), outBlock.getSize(), 0 );
202  }
203 
204  ZlibCompressionParameter parameter;
206 protected:
207  void initialize();
208 
209 private:
210  void *_strmp;
211  int _flush;
212 
213  void finalizeCompression();
214  void resetCompression();
215 };
217 } // namespace interface1
218 using interface1::ZlibCompressionParameter;
219 using interface1::Compressor;
220 using interface1::Decompressor;
221 
222 } //namespace data_management
223 } //namespace daal
224 #endif //__ZLIBCOMPRESSION_H
daal::data_management::interface1::Compressor
Compressor class compresses an input data block and writes results into an output data block...
Definition: compression.h:307
daal::data_management::interface1::Compressor< zlib >::run
void run(DataBlock &outBlock)
Definition: zlibcompression.h:136
daal
Definition: algorithm_base_common.h:57
daal::data_management::interface1::Compressor< zlib >::setInputDataBlock
void setInputDataBlock(DataBlock &inBlock)
Definition: zlibcompression.h:121
daal::data_management::CompressionLevel
CompressionLevel
Compression levels
Definition: compression.h:68
daal::data_management::defaultLevel
Definition: compression.h:70
daal::data_management::interface1::Compressor< zlib >::parameter
ZlibCompressionParameter parameter
Definition: zlibcompression.h:141
daal::data_management::interface1::ZlibCompressionParameter
Parameter for zlib compression and decompression.
Definition: zlibcompression.h:74
daal::data_management::interface1::DataBlock::getPtr
virtual byte * getPtr() const DAAL_C11_OVERRIDE
Definition: data_block.h:149
daal::data_management::interface1::DataBlock::getSize
virtual size_t getSize() const DAAL_C11_OVERRIDE
Definition: data_block.h:159
daal::data_management::interface1::Decompressor
Decompressor class decompresses an input data block and writes results into an output data block...
Definition: compression.h:329
daal::data_management::interface1::Decompressor< zlib >::parameter
ZlibCompressionParameter parameter
Definition: zlibcompression.h:204
daal::data_management::interface1::Decompressor< zlib >::run
void run(DataBlock &outBlock)
Definition: zlibcompression.h:199
daal::data_management::interface1::ZlibCompressionParameter::gzHeader
bool gzHeader
Definition: zlibcompression.h:88
daal::data_management::interface1::CompressionParameter
Parameters for compression and decompression.
Definition: compression.h:111
daal::algorithms::implicit_als::training::offset
Definition: implicit_als_training_types.h:174
daal::data_management::zlib
Definition: compression.h:90
daal::data_management::interface1::Decompressor< zlib >::setInputDataBlock
void setInputDataBlock(DataBlock &inBlock)
Definition: zlibcompression.h:184
daal::data_management::interface1::DataBlock
Class that stores a pointer to a byte array and its size. Not responsible for memory management...
Definition: data_block.h:109
daal::data_management::interface1::ZlibCompressionParameter::ZlibCompressionParameter
ZlibCompressionParameter(CompressionLevel clevel=defaultLevel, bool bgzHeader=false)
Definition: zlibcompression.h:83

For more complete information about compiler optimizations, see our Optimization Notice.