Luiza  v03-01
GloriaNetworkMgr.h
1 // -*- mode: c++; mode: auto-fill; mode: flyspell-prog; -*-
2 
3 
4 #ifndef GloriaNetworkMgr_h
5 #define GloriaNetworkMgr_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 "GloriaTelescope.h"
18 
19 namespace gloria{
20 
22 
34 
35  friend std::ostream& operator<< ( std::ostream& , GloriaNetworkMgr& ) ;
36 
37  public:
38 
40 
43 
45 
47  GloriaNetworkMgr(std::string fileName);
48 
51 
53  void LoadConfigXML(std::string fileName);
54 
56  inline long GetID() { return _id;} ;
57 
59  inline long GetDate() { return _date;} ;
60 
62  inline std::string GetAuthor() { return _author;} ;
63 
64 
66  inline int GetTelescopeNumber() { return _nTelescopes;} ;
67 
69  inline bool IsTelescopeDefined(std::string name)
70  { return _telescopeNameMap.find(name)!=_telescopeNameMap.end();};
71 
73  inline bool IsTelescopeDefined(int id)
74  { return _telescopeIdMap.find(id)!=_telescopeIdMap.end();};
75 
77  GloriaTelescope* GetTelescope(std::string name);
78 
81 
82 protected:
83 
84  long _id;
85  long _date;
86  std::string _author;
87 
88  std::vector< GloriaTelescope > _telescopeVec;
89 
90  std::map< std::string, int > _telescopeNameMap;
91 
92  std::map< int, int > _telescopeIdMap;
93 
94  int _nTelescopes;
95 
96  };
97 
98 
99 std::ostream& operator<< ( std::ostream& s, GloriaNetworkMgr& n ) ;
100 
101 }
102 
103 #endif
104 
105 
106 
void LoadConfigXML(std::string fileName)
Load network configuration from file.
Definition: GloriaNetworkMgr.cc:116
long GetDate()
Get configuration date.
Definition: GloriaNetworkMgr.h:59
~GloriaNetworkMgr()
Destructor.
Definition: GloriaNetworkMgr.cc:68
namespace for data storing and exchange formats
Definition: GloriaAstrometry.h:15
Class for storing GLORIA network configuration.
Definition: GloriaNetworkMgr.h:33
std::string GetAuthor()
Get configuration author.
Definition: GloriaNetworkMgr.h:62
int GetTelescopeNumber()
Number of telescopes defined in the configuration.
Definition: GloriaNetworkMgr.h:66
bool IsTelescopeDefined(int id)
Check if telescope configuration is defined.
Definition: GloriaNetworkMgr.h:73
Class for storing GLORIA telescope parameters.
Definition: GloriaTelescope.h:36
GloriaNetworkMgr()
Default constructor.
Definition: GloriaNetworkMgr.cc:46
bool IsTelescopeDefined(std::string name)
Check if telescope configuration is defined.
Definition: GloriaNetworkMgr.h:69
long GetID()
Get configuration ID.
Definition: GloriaNetworkMgr.h:56
GloriaTelescope * GetTelescope(std::string name)
Get telescope configuration by name or alias.
Definition: GloriaNetworkMgr.cc:75