1 #ifndef bstm_copy_data_to_future_function_h
2 #define bstm_copy_data_to_future_function_h
3 //:
4 // \file    This function copyies the data in the input time step into all future time nodes
5 
6 #include <iostream>
7 #include <bstm/bstm_data_traits.h>
8 #include <bstm/bstm_time_tree.h>
9 #include <bstm/bstm_data_base.h>
10 #include <boct/boct_bit_tree.h>
11 #include <vnl/vnl_vector.h>
12 #include <vnl/vnl_vector_fixed.h>
13 #ifdef _MSC_VER
14 #  include <vcl_msvc_warnings.h>
15 #endif
16 #include <bstm/io/bstm_cache.h>
17 
18 template <bstm_data_type APM_DATA_TYPE, bstm_data_type NOBS_DATA_TYPE >
19 class bstm_copy_data_to_future_function
20 {
21  public:
22   typedef unsigned char uchar;
23   typedef unsigned short ushort;
24   typedef vnl_vector_fixed<uchar, 16> uchar16;
25   typedef vnl_vector_fixed<uchar, 8> uchar8;
26   typedef vnl_vector_fixed<ushort, 4> ushort4;
27 
28   //: "default" constructor
29   bstm_copy_data_to_future_function(bstm_time_block* t_blk, bstm_block* blk,
30                       std::vector<bstm_data_base*> & datas, float time);
31 
32   //: initialize generic data base pointers as their data type
33   bool init_data(bstm_time_block* t_blk, bstm_block* blk, std::vector<bstm_data_base*> & datas, float local_time);
34 
35   bool copy();
36 
37  private:
38 
39   void move_data(bstm_time_tree& time_tree);
40 
41   bstm_time_block* blk_t_;
42   bstm_block* blk_;
43 
44   //TODO: data types are hardcoded for now
45   bstm_data_traits<BSTM_ALPHA>::datatype*       alpha_;
46   typename bstm_data_traits<APM_DATA_TYPE>::datatype*    mog_;
47   typename bstm_data_traits<NOBS_DATA_TYPE>::datatype*     num_obs_;
48   bstm_data_traits<BSTM_CHANGE>::datatype*     change_;
49 
50   float local_time_;
51 
52   unsigned num_el_; //the number of elements in meta data buffers
53 };
54 
55 #endif //bstm_copy_data_to_future_function_h
56