00001 #ifndef _INT_ARRAY_PARAM_DEF_H 00002 #define _INT_ARRAY_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: IntArrayParamDef.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::auto_ptr; 00041 using std::string; 00042 using std::vector; 00043 00046 namespace Parameters { 00047 00051 class IntArrayParamDef: public Parameters::ParamDef 00052 { 00053 public: 00057 IntArrayParamDef(); 00058 00062 IntArrayParamDef(const string & paramName, const string & helpText, const string & promptText, 00063 bool requiredBoolVal, auto_ptr< string > unitsText, auto_ptr< int > maxLen, auto_ptr< vector < int > > defaultVals); 00064 00068 virtual ~IntArrayParamDef(); 00069 00070 /* 00071 * Accessor for the units 00072 * @return the units as an auto_ptr to a string 00073 * if defined for this pdef, then the auto_ptr will 00074 * point to something meaningful, else null. 00075 */ 00076 auto_ptr<string> getUnits(); 00077 00078 /* 00079 * Accessor for the maxLen 00080 * @return the maxlen value as an auto_ptr to int 00081 * if defined for this pdef, then the auto_ptr will 00082 * point to something meaningful, else null. 00083 */ 00084 auto_ptr<int> getMaxLen(); 00085 00086 /* 00087 * Accessor for the default value. 00088 * @return the default value as an auto_ptr to a vector of int. 00089 * if defined for this pdef, then the auto_ptr will 00090 * point to something meaningful, else null. 00091 */ 00092 auto_ptr< vector<int> > getDefaultValues(); 00093 00094 /* 00095 * Accessor for the flag indicating if there are units 00096 * @return the flag indicating if there are units 00097 */ 00098 bool getHasUnits(); 00099 00100 /* 00101 * Accessor for flag indicating if there is maxLen 00102 * @return the flag indicating if there is maxlen value 00103 */ 00104 bool getHasMaxLen(); 00105 00106 /* 00107 * Accessor for the flag indicating if there is a default value. 00108 * @return the flag indicating if there is a default value 00109 */ 00110 bool getHasDefaultValues(); 00111 00112 private: 00113 vector<int> defaultValues_m; 00114 int maxLen_m; 00115 string units_m; 00116 00117 bool hasDefaultValues_m; 00118 bool hasMaxLen_m; 00119 bool hasUnits_m; 00120 }; 00121 00122 } 00123 #endif