1 // This is brl/bbas/bsta/bsta_joint_histogram_3d_base.h 2 #ifndef bsta_joint_histogram_3d_base_h_ 3 #define bsta_joint_histogram_3d_base_h_ 4 //: 5 // \file 6 // \brief Abstract base class for joint_histogram_3d 7 // \author Joseph L. Mundy 8 // \date June 29, 2011 9 // \verbatim 10 // Modifications 11 // \endverbatim 12 #include <vbl/vbl_ref_count.h> 13 #ifdef _MSC_VER 14 # include <vcl_msvc_warnings.h> 15 #endif 16 class bsta_joint_histogram_3d_base : public vbl_ref_count 17 { 18 public: 19 enum bsta_joint_hist_3d_type 20 { 21 HIST_TYPE_UNKNOWN = 0, 22 HIST_TYPE_FLOAT = 1, 23 HIST_TYPE_DOUBLE = 2, 24 HIST_TYPE_END = 3 25 }; bsta_joint_histogram_3d_base()26 bsta_joint_histogram_3d_base(): type_(HIST_TYPE_UNKNOWN){} 27 28 ~bsta_joint_histogram_3d_base() override = default; 29 30 bsta_joint_hist_3d_type type_; 31 }; 32 33 template <class T> 34 class bsta_joint_histogram_3d_traits 35 { 36 public: type()37 static bsta_joint_histogram_3d_base::bsta_joint_hist_3d_type type(){ 38 return bsta_joint_histogram_3d_base::HIST_TYPE_UNKNOWN;} 39 }; 40 41 template <> 42 class bsta_joint_histogram_3d_traits<float> 43 { 44 public: type()45 static bsta_joint_histogram_3d_base::bsta_joint_hist_3d_type type(){ 46 return bsta_joint_histogram_3d_base::HIST_TYPE_FLOAT;} 47 }; 48 49 template <> 50 class bsta_joint_histogram_3d_traits<double> 51 { 52 public: type()53 static bsta_joint_histogram_3d_base::bsta_joint_hist_3d_type type(){ 54 return bsta_joint_histogram_3d_base::HIST_TYPE_DOUBLE;} 55 }; 56 57 #endif // bsta_joint_histogram_3d_base_h_ 58