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