Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

Valuator.hxx

00001 
00002 // 
00003 // Copyright (C) 2006 James M. Lawrence.  All rights reserved.
00004 // 
00005 // software: esve-1.0.3
00006 // file: esve/components/dimn/Valuator.hxx
00007 // 
00008 // Redistribution and use in source and binary forms, with or without
00009 // modification, are permitted provided that the following conditions
00010 // are met:
00011 // 
00012 // 1. Redistributions of source code must retain the above copyright
00013 //    notice, this list of conditions and the following disclaimer.
00014 // 
00015 // 2. The origin of this software must not be misrepresented; you must
00016 //    not claim that you wrote the original software.  If you use this
00017 //    software in a product, an acknowledgment in the product 
00018 //    documentation would be appreciated but is not required.
00019 // 
00020 // 3. Altered source versions must be plainly marked as such, and must
00021 //    not be misrepresented as being the original software.
00022 // 
00023 // 4. The name of the author may not be used to endorse or promote
00024 //    products derived from this software without specific prior written
00025 //    permission.
00026 // 
00027 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY,
00028 // AND WITH NO CLAIM AS TO ITS SUITABILITY FOR ANY PURPOSE.  IN NO EVENT
00029 // SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM WHATSOEVER MADE IN CONNECTION
00030 // TO THIS SOFTWARE.
00031 // 
00033 
00034 #ifndef esve_components_dimn_Valuator_hxx
00035 #define esve_components_dimn_Valuator_hxx
00036 
00037 #include <esve/ui/extra/Widget.hxx>
00038 #include <esve/types/complex.hxx>
00039 
00040 namespace esve { namespace components { namespace dimn {
00041 
00064 
00065 template< typename T_Value >
00066 class Valuator
00067     : public ui::extra::Widget
00068 {
00069 public:
00071     virtual T_Value value() const = 0 ;
00072 
00078     virtual Valuator & value( const T_Value & ) = 0 ;
00079 
00084     virtual Valuator & step( const T_Value & ) = 0 ;
00085 
00090     virtual
00091     Valuator &
00092     range( const T_Value & min_corner,
00093            const T_Value & max_corner ) = 0 ;
00094 
00095 protected:
00096     Valuator() { }
00097 
00098     // creator owns it
00099     ~Valuator() { }
00100 
00101 private:
00102     Valuator( const Valuator & ) ;
00103     Valuator & operator=( const Valuator & ) ;
00104 } ;
00105 
00106 template<>
00107 class Valuator<types::real>
00108     : public ui::extra::Widget
00109 {
00110 public:
00112     virtual types::real value() const = 0 ;
00113 
00118     virtual Valuator & value( types::real ) = 0 ;
00119 
00124     virtual Valuator & step( types::real ) = 0 ;
00125 
00130     virtual
00131     Valuator &
00132     range( types::real min, types::real max ) = 0 ;
00133 
00134 protected:
00135     Valuator() { }
00136 
00137     // creator owns it
00138     ~Valuator() { }
00139 
00140 private:
00141     Valuator( const Valuator & ) ;
00142     Valuator & operator=( const Valuator & ) ;
00143 } ;
00144 
00145 template<>
00146 class Valuator<types::complex>
00147     : public ui::extra::Widget
00148 {
00149 public:
00151     virtual types::complex value() const = 0 ;
00152 
00158     virtual Valuator & value( const types::complex & ) = 0 ;
00159     virtual Valuator & value( types::real , types::real ) = 0 ;
00161 
00167     virtual Valuator & step( const types::complex & ) = 0 ;
00168     virtual Valuator & step( types::real, types::real ) = 0 ;
00170 
00175     virtual
00176     Valuator &
00177     range( const types::complex & lower_left_corner,
00178            const types::complex & upper_right_corner ) = 0 ;
00179 
00180 protected:
00181     Valuator() { }
00182 
00183     // creator owns it
00184     ~Valuator() { }
00185 
00186 private:
00187     Valuator( const Valuator & ) ;
00188     Valuator & operator=( const Valuator & ) ;
00189 } ;
00190 
00191 }}} // namespace esve::components::dimn
00192 
00193 #endif
00194 

Generated on Tue May 30 11:40:53 2006 for esve by doxygen 1.3.4