• Classes
  • Modules
  • Namespaces
  • Files
  • Related Pages
  • File List
  • File Members

IntParamDef.h

Go to the documentation of this file.
00001 #ifndef _INT_PARAM_DEF_H
00002 #define _INT_PARAM_DEF_H
00003 /*******************************************************************************
00004 *    ALMA - Atacama Large Millimiter Array
00005 *    (c) Associated Universities Inc., 2002 
00006 *    (c) European Southern Observatory, 2002
00007 *    Copyright by ESO (in the framework of the ALMA collaboration)
00008 *    and Cosylab 2002, All rights reserved
00009 *
00010 *    This library is free software; you can redistribute it and/or
00011 *    modify it under the terms of the GNU Lesser General Public
00012 *    License as published by the Free Software Foundation; either
00013 *    version 2.1 of the License, or (at your option) any later version.
00014 *
00015 *    This library is distributed in the hope that it will be useful,
00016 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 *    Lesser General Public License for more details.
00019 *
00020 *    You should have received a copy of the GNU Lesser General Public
00021 *    License along with this library; if not, write to the Free Software
00022 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00023 *
00024 * "@(#) $Id: IntParamDef.h,v 1.3 2006/11/29 23:01:26 sharring Exp $"
00025 *
00026 * who       when      what
00027 * --------  --------  ----------------------------------------------
00028 * sharring  10/27/04  created
00029 */
00030 
00031 #ifndef __cplusplus
00032 #error This is a C++ include file and cannot be used from plain C
00033 #endif
00034 
00035 #include <ParamDef.h>
00036 #include <memory>
00037 #include <string>
00038 #include <vector>
00039 
00040 using std::string;
00041 using std::vector;
00042 using std::auto_ptr;
00043 
00046 namespace Parameters {
00047 
00051         class IntParamDef: public Parameters::ParamDef
00052         {    
00053           public:
00057             IntParamDef();
00058             
00062            IntParamDef(const string & nameVal, const string & helpVal, const string & promptVal, 
00063                         bool isRequired, auto_ptr< int > defaultVal, auto_ptr< string > strDefault,
00064                         auto_ptr< string > unitsVal, auto_ptr< int > maxVal, auto_ptr< int > minVal, 
00065                         auto_ptr< vector<int> > validVals);
00066 
00070             virtual ~IntParamDef();
00071             
00072             /*
00073              * Accessor for the default value.
00074              * @return the default value as an integer auto_ptr
00075              * if defined for this pdef, then the auto_ptr will 
00076              * point to something meaningful, else null.
00077              */
00078             auto_ptr< int > getDefault();
00079             
00080             /*
00081              * Accessor for the string default value.
00082              * @return the string default value as a string auto_ptr
00083              * if defined for this pdef, then the auto_ptr will 
00084              * point to something meaningful, else null.
00085              */
00086             auto_ptr< string > getStringDefault();
00087             
00088             /*
00089              * Accessor for the units.
00090              * @return the units as a string auto_ptr
00091              * if defined for this pdef, then the auto_ptr will 
00092              * point to something meaningful, else null.
00093              */
00094             auto_ptr< string > getUnits();
00095             
00096             /*
00097              * Accessor for the max value.
00098              * @return the max value as an integer auto_ptr
00099              * if defined for this pdef, then the auto_ptr will 
00100              * point to something meaningful, else null.
00101              */
00102             auto_ptr< int > getMax();
00103             
00104             /*
00105              * Accessor for the min value.
00106              * @return the min value as an integer auto_ptr
00107              * if defined for this pdef, then the auto_ptr will 
00108              * point to something meaningful, else null.
00109              */
00110             auto_ptr< int > getMin();
00111             
00112             /*
00113              * Accessor for the valid values.
00114              * @return the valid values as an auto_ptr to a vector of ints
00115              * if defined for this pdef, then the auto_ptr will 
00116              * point to something meaningful, else null.
00117              */
00118             auto_ptr< vector<int> > getValidValues();
00119             
00120             /*
00121              * Accessor for the flag indicating if there is a default value.
00122              * @return the flag indicating if there is a default value 
00123              */
00124             bool getHasDefault();
00125             
00126             /*
00127              * Accessor for the flag indicating if there is a string default value.
00128              * @return the flag indicating if there is a string default value 
00129              */
00130             bool getHasStringDefault();
00131             
00132             /*
00133              * Accessor for the flag indicating if there is a units.
00134              * @return the flag indicating if there is a units 
00135              */
00136             bool getHasUnits();
00137             
00138             /*
00139              * Accessor for the flag indicating if there is a max value.
00140              * @return the flag indicating if there is a max value 
00141              */
00142             bool getHasMax();
00143             
00144             /*
00145              * Accessor for the flag indicating if there is a min value.
00146              * @return the flag indicating if there is a min value 
00147              */
00148             bool getHasMin();
00149             
00150             /*
00151              * Accessor for the flag indicating if there is a valid values.
00152              * @return the flag indicating if there is a valid values 
00153              */
00154             bool getHasValidValues();
00155 
00156           private:
00157             string stringDefault_m;
00158             string units_m;
00159             int defaultValue_m;
00160             int max_m;
00161             int min_m;
00162             vector<int> validValues_m;
00163 
00164             bool hasDefault_m;
00165             bool hasStringDefault_m;
00166             bool hasMax_m;
00167             bool hasMin_m;
00168             bool hasValidValues_m;
00169             bool hasUnits_m;
00170         };
00171 
00172 }
00173 #endif 

Generated on Thu Jan 12 2012 23:13:51 for ACS-10.0 C++ API by  doxygen 1.7.0