SHOGUN  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Compressor.h
Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 2009 Soeren Sonnenburg
00008  * Copyright (C) 2009 Berlin Institute of Technology
00009  */
00010 #ifndef __COMPRESSOR_H__
00011 #define __COMPRESSOR_H__
00012 
00013 #include <shogun/lib/config.h>
00014 #include <shogun/lib/common.h>
00015 #include <shogun/base/SGObject.h>
00016 #include <shogun/io/SGIO.h>
00017 
00018 namespace shogun
00019 {
00021     enum E_COMPRESSION_TYPE
00022     {
00023         UNCOMPRESSED,
00024         LZO,
00025         GZIP,
00026         BZIP2,
00027         LZMA,
00028         SNAPPY
00029     };
00030 
00031 
00046     class CCompressor : public CSGObject
00047     {
00048     public:
00050         CCompressor();
00051 
00056         CCompressor(E_COMPRESSION_TYPE ct) : CSGObject(), compression_type(ct)
00057         {
00058         }
00059 
00061         virtual ~CCompressor()
00062         {
00063         }
00064 
00076         void compress(uint8_t* uncompressed, uint64_t uncompressed_size,
00077                 uint8_t* &compressed, uint64_t &compressed_size, int32_t level=1);
00078 
00091         void decompress(uint8_t* compressed, uint64_t compressed_size,
00092                 uint8_t* uncompressed, uint64_t& uncompressed_size);
00093 
00095         virtual const char* get_name() const { return "Compressor"; }
00096 
00097     protected:
00099         E_COMPRESSION_TYPE compression_type;
00100     };
00101 }
00102 #endif //__COMPRESSOR_H__
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation