Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

AbsParameter.hpp

00001 #ifndef __AbsParameter__
00002 #define __AbsParameter__
00003 
00004 
00005 
00024 #include <stdio.h>
00025 
00026 
00027 enum  ParameterType { Integer=0, Bool= 1, Real=2, String=3, Structured=4, Object=5 };
00028 
00029 class AbsParameter
00030 {
00031 private:
00032 
00033 char*                           name;
00034 ParameterType           type;
00035 int                                     cardinality;
00036 bool                            rangeFlag;
00037 
00038 public:
00039         
00040 AbsParameter(char* aname, ParameterType atype= Integer, int acardinality=1, bool arangeFlag=false )
00041         {
00042         name= aname; 
00043         type= atype;
00044         cardinality= acardinality;
00045         rangeFlag= arangeFlag;
00046         }
00047 
00048 virtual ~AbsParameter(){delete[] name;}
00049 
00050 virtual char*                   getName(){return name;}
00051 virtual ParameterType   getType(){return type;}
00052 
00053 virtual int                             getCardinality(){ return cardinality; }
00054 virtual bool                    hasARange(){ return rangeFlag; }
00055 
00056 // as bool
00057 virtual bool                    getBool()=0;
00058 virtual bool                    getDefaultBool()=0;
00059 
00060 virtual void                    setBool(bool val)=0;
00061 virtual void                    setDefaultBool(bool val)=0;
00062 
00063 // as integer
00064 virtual void                    addInteger(int value){}
00065 
00066 virtual int                             getInteger()=0;
00067 virtual int                             getDefaultInteger()=0;
00068 virtual int                             getMinInteger()=0;
00069 virtual int                             getMaxInteger()=0;
00070 virtual int                             getInteger(int index)=0;
00071 
00072 virtual void                    setInteger(int val)=0;
00073 virtual void                    setDefaultInteger(int val)=0;
00074 virtual void                    setRangeInteger(int low, int high)=0;
00075 virtual void                    setInteger(int index, int val)=0;
00076 
00077 // as real
00078 virtual void                    addReal(double value){}
00079 
00080 virtual double                  getReal()=0;
00081 virtual double                  getDefaultReal()=0;
00082 virtual double                  getMinReal()=0;
00083 virtual double                  getMaxReal()=0;
00084 virtual double                  getReal(int index)=0;
00085 
00086 virtual void                    setReal(double val)=0;
00087 virtual void                    setDefaultReal(double val)=0;
00088 virtual void                    setRangeReal(int low, double high)=0;
00089 virtual void                    setReal(int index, double val)=0;
00090 
00091 // as real
00092 virtual void                    addString(char* value){}
00093 
00094 virtual char*                   getString()=0;
00095 virtual char*                   getDefaultString()=0;
00096 virtual char*                   getString(int index)=0;
00097 
00098 virtual void                    setString(char* val)=0;
00099 virtual void                    setDefaultString(char* val)=0;
00100 virtual void                    setString(int index, char* val)=0;
00101 
00102 virtual char*                   shortDescription()=0;
00103 virtual char*                   description()=0;
00104 
00105 virtual void report(FILE* file){}
00106 };
00107 
00108 
00109 #endif
SourceForge.net Logo
Restoreinpaint sourceforge project `C++/Java Image Processing, Restoration, Inpainting Project'.

Bernard De Cuyper: Open Project Leader: Concept, design and development.
Bernard De Cuyper & Eddy Fraiha 2002, 2003. Bernard De Cuyper 2004. Open and free, for friendly usage only.
Modifications on Belgium ground of this piece of artistic work, by governement institutions or companies, must be notified to Bernard De Cuyper.
bern_bdc@hotmail.com