sdbf
3.3
|
00001 00002 // Header file for sdbf object 00003 // 00004 #ifndef _SDBF_CONF_H 00005 #define _SDBF_CONF_H 00006 00007 #include "sdbf_defines.h" 00008 00009 #include <stdint.h> 00010 #include <stdio.h> 00011 00012 /** 00013 Configuration object for sdbf classes. Used as a static class member to provide 00014 globally tunable defaults and access to bit counting structures. 00015 */ 00016 class sdbf_conf { 00017 00018 public: 00019 /// constructor: set defaults 00020 sdbf_conf(uint32_t thread_cnt, uint32_t warnings, uint32_t max_elem_ct, uint32_t max_elem_ct_dd ); 00021 /// destructor 00022 ~sdbf_conf(); 00023 public: 00024 /// number of pthreads available 00025 uint32_t thread_cnt; 00026 uint32_t entr_win_size; 00027 uint32_t bf_size; 00028 uint32_t pop_win_size; 00029 uint32_t block_size; 00030 /// maximum elements per bf 00031 uint32_t max_elem; 00032 /// maximum elements per bf - dd mode 00033 uint32_t max_elem_dd; 00034 /// whether to process warnings 00035 uint32_t warnings; 00036 uint32_t threshold; 00037 bool popcnt; 00038 00039 // collection of static variables used to hold data-collecting elements 00040 static uint8_t bit_count_16[64*KB]; 00041 static uint16_t bf_est_cache[256][256]; 00042 static uint32_t ENTR64_RANKS[]; 00043 static uint32_t BIT_MASKS[]; 00044 static uint8_t BITS[]; 00045 static uint32_t BF_CLASS_MASKS[]; 00046 uint64_t ENTROPY_64_INT[65]; 00047 00048 public: 00049 // setup functions 00050 void entr64_table_init_int(); 00051 uint64_t entr64_init_int( const uint8_t *buffer, uint8_t *ascii); 00052 uint64_t entr64_inc_int( uint64_t entropy, const uint8_t *buffer, uint8_t *ascii); 00053 00054 void init_bit_count_16(); 00055 00056 }; 00057 00058 #endif