Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ippParam.h

Go to the documentation of this file.
00001 // 
00002 // DISCLAIMER: 
00003 //  This software was produced by the National Institute of Standards 
00004 //  and Technology (NIST), an agency of the U.S. government, and by statute is 
00005 //  not subject to copyright in the United States.  Recipients of this 
00006 //  software assume all responsibility associated with its operation,
00007 //  modification,maintenance, and subsequent redistribution. 
00008 //
00009 //  See NIST Administration Manual 4.09.07 b and Appendix I. 
00010 #pragma once 
00011 
00012 #include "ippdme/ippdme.h"
00014 
00017 class IPPDME_EXT_CLASS ippParam
00018 {
00019 
00020 private:  
00021   double _act; // the actual value
00022   double _def; // the default value
00023   double _max; // the maximum value allowed
00024   double _min; // the minimum value allowed
00025 public:
00026 
00027   // default constructor
00028   ippParam() { _act = 1.0; _def = 1.0; _max=10.0; _min = 0.1;}
00029  
00030   // destructor
00031   ~ippParam(){}
00032 
00033 
00034   bool getProperty(ippOtherKeyType key,double& value) const;
00035 
00036   // @return the actual value
00037   double getAct()const {return _act;}
00038 
00039   // sets the actual value
00040   double setAct(double newAct)
00041   {
00042       _act = ((newAct > _max) ? _max : (newAct < _min) ? _min : newAct);
00043       return _act;
00044   }
00045   
00046   double getDef()const {return _def;}
00047 
00048   double setDef(double newDef)
00049     {
00050       _def = ((newDef > _max) ? _max : (newDef < _min) ? _min : newDef);
00051       return _def;
00052     }
00053   double getMax()const {return _max;}
00054 
00055   double setMax(double newMax)
00056   {
00057       double bigger;
00058       bigger = ((_act > _def) ? _act : _def);
00059       _max = ((newMax > bigger) ? newMax : bigger); 
00060       return _max;
00061   }
00062   
00063   double getMin()const {return _min;}
00064 
00065   double setMin(double newMin)
00066   {
00067       double smaller;
00068       smaller = ((_act < _def) ? _act : _def);
00069       _min = ((newMin < smaller) ? newMin : smaller);
00070       return _min;
00071   }
00072 private:
00073   ippParam(const ippParam&);
00074   void operator=(const ippParam&);
00075 };
00076 
00077 
00078 
00079 inline bool ippParam::getProperty(ippOtherKeyType key,double& value) const
00080 {
00081   switch(key)
00082   {
00083     case EmptyKey: value = _act ; return true;
00084     case Min: value = _min ; return true;
00085     case Max: value = _max ; return true;
00086     case Default: value = _def ; return true;
00087     case Actual: value = _act ; return true;
00088   }
00089   return false;
00090 }

Generated on Wed Nov 8 00:19:58 2006 for IPPDME by  doxygen 1.4.1