00001 #ifndef _DIVINE_COMPRESSOR_HH_ 00002 #define _DIVINE_COMPRESSOR_HH_ 00003 00011 #include "system/state.hh" 00012 #include "common/error.hh" 00013 00014 #define NO_COMPRESS 11 00015 #define HUFFMAN_COMPRESS 12 00016 00017 namespace divine { 00018 00020 class compressor_t { 00021 private: 00022 char * compress_buffer; 00023 size_int_t compress_buffer_size; 00024 public: 00026 compressor_t() 00027 { 00028 compress_buffer_size = 4096; 00029 compress_buffer = new char[compress_buffer_size]; 00030 } 00031 00033 ~compressor_t() 00034 { 00035 delete [] compress_buffer; 00036 } 00037 00039 00041 bool compress(state_t, char *& pointer, int& size); 00042 00044 00047 bool compress_without_alloc(state_t, char *& pointer, int& size); 00048 00049 00051 00053 bool decompress(state_t&, char *pointer, int size); 00054 00056 00059 bool init(int method, int appendix_size); 00060 00062 00064 void clear(); 00065 00066 private: 00067 int method_id; 00068 int oversize; 00069 }; 00070 00071 }; 00072 00073 #endif 00074 00075