decoder_manager.hh

Go to the documentation of this file.
00001 
00015 #ifndef DECODER_MANAGER_HH
00016 #define DECODER_MANAGER_HH
00017 
00018 #include <algorithm>
00019 #include <iterator>
00020 #include <vector>
00021 #include <time.h>
00022 
00023 #include "storage_manager.hh"
00024 #include "bin_io_handler.hh"
00025 #include "algo_base.hh"
00026 #include "ana_base.hh"
00027 
00034 class decoder_manager : public decoder_base {
00035 
00036 public:
00037 
00039   decoder_manager();
00040 
00042   virtual ~decoder_manager(){};
00043 
00045   void add_input_filename(std::string name){ _bin_files.push_back(name);};
00046 
00048   void set_output_filename(std::string name){ _storage->set_out_filename(name);};
00049 
00050   void set_data_to_write(DATA_STRUCT::DATA_TYPE type,bool write=true)
00051   {_storage->set_data_to_write(type,write);};
00052 
00054   void set_format(FORMAT::INPUT_FILE fmt){_fin.set_format(fmt);};
00055 
00057   void set_decoder(algo_base* algo){_decoder=algo;};
00058 
00060   void debug_mode(bool debug){_debug_mode=debug;};
00061 
00063   bool run();
00064 
00066   void reset();
00067 
00069   void set_read_by_block(bool doit=true){_read_by_block=doit;};
00070 
00077   void set_read_block_size(size_t n){_read_block_size=n;};
00078   
00079 private:
00080 
00082   bool initialize();
00083 
00085   bool decode();
00086 
00088   bool finalize();
00089 
00091   bool open_file();
00092 
00093   //
00094   // Run control variables
00095   //
00096   bool _debug_mode;   
00097   
00098   std::vector<ana_base*> _analyzers; 
00099 
00100   //
00101   // File IO variables
00102   //
00103   std::string _input_file;    
00104   std::vector<std::string> _bin_files;
00105   std::vector<std::string>::iterator _bin_file_iter;
00106   bin_io_handler _fin;        
00107 
00113   bool _read_by_block;        
00114 
00116   size_t _read_block_size;
00117 
00118   // storage I/O
00119   storage_manager* _storage;  
00120   algo_base* _decoder;        
00121 
00122 };
00123 
00124 #endif
00125  // end of doxygen group 

Generated on Mon Apr 7 15:35:12 2014 for MyProject by  doxygen 1.4.7