00001 // This is brl/bbas/bsta/bsta_histogram_base.h 00002 #ifndef bsta_histogram_base_h_ 00003 #define bsta_histogram_base_h_ 00004 //: 00005 // \file 00006 // \brief Abstract histogram base class 00007 // \author Joseph Mundy 00008 // \date March 1, 2008 00009 // 00010 // \verbatim 00011 // \endverbatim 00012 00013 #include <vbl/vbl_ref_count.h> 00014 #include <vcl_compiler.h> 00015 class bsta_histogram_base : public vbl_ref_count 00016 { 00017 public: 00018 enum bsta_hist_type 00019 { 00020 HIST_TYPE_UNKNOWN = 0, 00021 HIST_TYPE_FLOAT = 1, 00022 HIST_TYPE_DOUBLE = 2, 00023 HIST_TYPE_END = 3 00024 }; 00025 //: Default constructor 00026 bsta_histogram_base(): type_(HIST_TYPE_UNKNOWN){} 00027 00028 virtual ~bsta_histogram_base() {} 00029 00030 bsta_hist_type type_; 00031 }; 00032 00033 template <class T> 00034 class bsta_histogram_traits 00035 { 00036 public: 00037 static bsta_histogram_base::bsta_hist_type type(){ 00038 return bsta_histogram_base::HIST_TYPE_UNKNOWN;} 00039 }; 00040 00041 VCL_DEFINE_SPECIALIZATION 00042 class bsta_histogram_traits<float> 00043 { 00044 public: 00045 static bsta_histogram_base::bsta_hist_type type(){ 00046 return bsta_histogram_base::HIST_TYPE_FLOAT;} 00047 }; 00048 00049 VCL_DEFINE_SPECIALIZATION 00050 class bsta_histogram_traits<double> 00051 { 00052 public: 00053 static bsta_histogram_base::bsta_hist_type type(){ 00054 return bsta_histogram_base::HIST_TYPE_DOUBLE;} 00055 }; 00056 00057 00058 #endif // bsta_histogram_base_h_