orsa_config.h

Go to the documentation of this file.
00001 /* 
00002    ORSA - Orbit Reconstruction, Simulation and Analysis
00003    Copyright (C) 2002-2004 Pasquale Tricarico
00004    
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public License
00007    as published by the Free Software Foundation; either version 2
00008    of the License, or (at your option) any later version.
00009    
00010    As a special exception, Pasquale Tricarico gives permission to
00011    link this program with Qt commercial edition, and distribute the
00012    resulting executable, without including the source code for the Qt
00013    commercial edition in the source distribution.
00014    
00015    This program 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
00018    GNU General Public License for more details.
00019    
00020    You should have received a copy of the GNU General Public License
00021    along with this program; if not, write to the Free Software
00022    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023 */
00024 
00025 #ifndef _ORSA_CONFIG_H_
00026 #define _ORSA_CONFIG_H_
00027 
00028 #include <string>
00029 #include <map>
00030 
00031 namespace orsa {
00032   
00033   class OrsaConfigFile;
00034   
00035   template <class T> class ConfigItem {
00036   public:
00037     ConfigItem(const std::string t) : tag(t) { };
00038     ConfigItem(const T v, const std::string t) : value(v), tag(t) { };
00039     
00040   public:
00041     T    GetValue() const    { return value; }
00042     void SetValue(const T v) { value = v; }
00043     
00044   private:
00045     T value;
00046     
00047   public:
00048     const std::string tag;
00049   };
00050   
00051   enum ConfigEnum {
00052     JPL_EPHEM_FILE,
00053     JPL_DASTCOM_NUM,
00054     JPL_DASTCOM_UNNUM,
00055     JPL_DASTCOM_COMET,
00056     LOWELL_ASTORB,
00057     MPC_MPCORB,
00058     MPC_COMET,
00059     MPC_NEA,
00060     MPC_DAILY,
00061     MPC_DISTANT,
00062     MPC_PHA,
00063     MPC_UNUSUALS,
00064     ASTDYS_ALLNUM_CAT,
00065     ASTDYS_ALLNUM_CTC,
00066     ASTDYS_ALLNUM_CTM,
00067     ASTDYS_UFITOBS_CAT,
00068     ASTDYS_UFITOBS_CTC,
00069     ASTDYS_UFITOBS_CTM,
00070     NEODYS_CAT,
00071     NEODYS_CTC,
00072     OBSCODE,
00073     // TLE files
00074     TLE_NASA,
00075     TLE_GEO,
00076     TLE_GPS,
00077     TLE_ISS,
00078     TLE_KEPELE,
00079     TLE_VISUAL,
00080     TLE_WEATHER,
00081     // textures
00082     TEXTURE_SUN,
00083     TEXTURE_MERCURY,
00084     TEXTURE_VENUS,
00085     TEXTURE_EARTH,
00086     TEXTURE_MOON,
00087     TEXTURE_MARS,
00088     TEXTURE_JUPITER,
00089     TEXTURE_SATURN,
00090     TEXTURE_URANUS,
00091     TEXTURE_NEPTUNE,
00092     TEXTURE_PLUTO,
00093     // 
00094     NO_CONFIG_ENUM
00095   };
00096   
00097   std::string Label(const ConfigEnum);
00098   
00099   class Config {
00100   public:
00101     Config();
00102     
00103   public:
00104     std::map < ConfigEnum, ConfigItem<std::string>* > paths;
00105     
00106   public:
00107     static void read_from_file();
00108     static void write_to_file();
00109   };
00110   
00111   //! The active configuration
00112   extern Config * config;
00113   
00114 } // namespace orsa
00115 
00116 #endif // _ORSA_CONFIG_H_

Generated on Wed May 30 13:04:52 2007 for liborsa by  doxygen 1.5.2