Luiza  v03-01
GloriaTelescope.h
1 // -*- mode: c++; mode: auto-fill; mode: flyspell-prog; -*-
2 
3 
4 #ifndef GloriaTelescope_h
5 #define GloriaTelescope_h 1
6 
7 
8 /*
9  * This source code is part of the LUIZA software package for GLORIA.
10  * You are free to use this source files for your own development as
11  * long as it stays in a public research context. You are not
12  * allowed to use it for commercial purpose. You must put this
13  * header with author names in all development based on this file.
14  *
15  */
16 
17 #include "luiza/StringParameters.h"
18 #include <iostream>
19 #include <vector>
20 #include <string>
21 #include <map>
22 
23 namespace gloria{
24 
26 
37 
38  friend std::ostream& operator<< ( std::ostream& , GloriaTelescope& ) ;
39 
40  public:
41 
43 
46 
48 
51 
53 
55  GloriaTelescope(int id, std::string name);
56 
59 
61  inline void SetID(int id) { _id = id; };
62 
64  inline void SetName(std::string name) { _name.push_back(name); };
65 
67  inline void SetPosition(double lon, double lat, double elev)
68  { _longitude=lon; _latitude=lat; _elevation=elev;};
69 
71  void AddParameter(std::string name, std::string value);
72 
73 
74 
76  inline int GetID() { return _id;} ;
77 
79  inline int GetNameNumber() { return _name.size();} ;
80 
82  inline std::string GetName(int iname=0) { return _name.at(iname);} ;
83 
84 
86  inline bool IsParameterSet(std::string key) { return _parameters->isParameterSet(key);} ;
87 
89  inline std::string GetStringParameter(std::string key) { return _parameters->getStringVal(key);} ;
90 
92  inline int GetIntParameter(std::string key) { return _parameters->getIntVal(key);} ;
93 
95  inline float GetFloatParameter(std::string key) { return _parameters->getFloatVal(key);} ;
96 
98  virtual luiza::StringParameters* parameters() { return _parameters ; }
99 
100 private:
101 
102  int _id;
103 
104  std::vector< std::string > _name;
105 
106  double _longitude, _latitude, _elevation;
107 
108  // StringParameters class allow for manipulation of arbitrary parameters
109  // parameters are stored in std::map< std::string , std::vector< std::string > >
110 
111 
112  luiza::StringParameters* _parameters;
113  };
114 
115 
116 
117 std::ostream& operator<< ( std::ostream& s, GloriaTelescope& t ) ;
118 
119 }
120 
121 #endif
122 
int GetNameNumber()
Get number of telescope name/aliases.
Definition: GloriaTelescope.h:79
float GetFloatParameter(std::string key)
Get telescope parameter as float.
Definition: GloriaTelescope.h:95
namespace for data storing and exchange formats
Definition: GloriaAstrometry.h:15
int GetIntParameter(std::string key)
Get telescope parameter as int.
Definition: GloriaTelescope.h:92
~GloriaTelescope()
Destructor.
Definition: GloriaTelescope.cc:58
int GetID()
Get telescope ID.
Definition: GloriaTelescope.h:76
void SetPosition(double lon, double lat, double elev)
Define telescope position.
Definition: GloriaTelescope.h:67
std::string GetStringParameter(std::string key)
Get telescope parameter as a string.
Definition: GloriaTelescope.h:89
std::string GetName(int iname=0)
Get telescope name.
Definition: GloriaTelescope.h:82
void AddParameter(std::string name, std::string value)
Add parameter.
Definition: GloriaTelescope.cc:66
Class for storing GLORIA telescope parameters.
Definition: GloriaTelescope.h:36
virtual luiza::StringParameters * parameters()
Return parameters defined for this telescope.
Definition: GloriaTelescope.h:98
void SetName(std::string name)
Add telescope name/alias.
Definition: GloriaTelescope.h:64
void SetID(int id)
Define telescope ID.
Definition: GloriaTelescope.h:61
GloriaTelescope()
Default constructor.
Definition: GloriaTelescope.cc:20
bool IsParameterSet(std::string key)
Check if telescope parameter is set.
Definition: GloriaTelescope.h:86