SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Compressor.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2009 Soeren Sonnenburg
8  * Copyright (C) 2009 Berlin Institute of Technology
9  */
10 #ifndef __COMPRESSOR_H__
11 #define __COMPRESSOR_H__
12 
13 #include <shogun/lib/config.h>
14 #include <shogun/lib/common.h>
15 #include <shogun/base/SGObject.h>
16 #include <shogun/io/SGIO.h>
17 
18 #ifdef USE_LZO
19 #include <lzo/lzoconf.h>
20 #include <lzo/lzo1x.h>
21 #endif
22 
23 namespace shogun
24 {
27  {
29  LZO,
34  };
35 
36 
49  class CCompressor : public CSGObject
50  {
51  public:
53  CCompressor();
54 
60  {
61  }
62 
64  virtual ~CCompressor()
65  {
66  }
67 
79  void compress(uint8_t* uncompressed, uint64_t uncompressed_size,
80  uint8_t* &compressed, uint64_t &compressed_size, int32_t level=1);
81 
94  void decompress(uint8_t* compressed, uint64_t compressed_size,
95  uint8_t* uncompressed, uint64_t& uncompressed_size);
96 
98  inline virtual const char* get_name() const { return "Compressor"; }
99 
100  protected:
103  };
104 }
105 #endif //__COMPRESSOR_H__
E_COMPRESSION_TYPE compression_type
Definition: Compressor.h:102
Compression library for compressing and decompressing buffers using one of the standard compression a...
Definition: Compressor.h:49
virtual const char * get_name() const
Definition: Compressor.h:98
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:76
E_COMPRESSION_TYPE
Definition: Compressor.h:26
void compress(uint8_t *uncompressed, uint64_t uncompressed_size, uint8_t *&compressed, uint64_t &compressed_size, int32_t level=1)
Definition: Compressor.cpp:44
void decompress(uint8_t *compressed, uint64_t compressed_size, uint8_t *uncompressed, uint64_t &uncompressed_size)
Definition: Compressor.cpp:209
CCompressor(E_COMPRESSION_TYPE ct)
Definition: Compressor.h:59
virtual ~CCompressor()
Definition: Compressor.h:64

SHOGUN Machine Learning Toolbox - Documentation