00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef HxUpoThreshold_h
00011 #define HxUpoThreshold_h
00012
00013 #include "HxValue.h"
00014 #include "HxTagList.h"
00015 #include "HxClassName.h"
00016 #include "HxScalarInt.h"
00017
00018
00019 template<class DstValT, class SrcValT>
00020 class HxUpoThreshold
00021 {
00022 public:
00023 HxUpoThreshold(HxTagList& tags)
00024 { _level = HxGetTag<HxValue>(tags, "level"); }
00025
00026 DstValT doIt(const SrcValT& x)
00027 { return x >= _level ? HxScalarInt(1) : HxScalarInt(0);}
00028
00029 static HxString className()
00030 { return HxString("threshold"); }
00031
00032 private:
00033 SrcValT _level;
00034 };
00035
00036 #endif
00037