MolecularDB.h
Go to the documentation of this file.
1 #ifndef _atm_MolecularDB_h_
2 #define _atm_MolecularDB_h_
3 
4 #include <atm/MolecularZone.h>
5 #include <atm/MolecularIds.h>
6 
7 #include <boost/iterator/transform_iterator.hpp>
8 
9 #include <map>
10 #include <string>
11 #include <vector>
12 
13 
14 namespace atm {
15 
16 
29  class MolecularDB {
30 
31  private:
32  void CacheZones();
33 
34  typedef std::map<std::string, const MolecularZone*> InternalZoneMap;
35  typedef InternalZoneMap::const_iterator InternalZoneIterator;
36 
38 
40  const MolecularZone& operator() (const std::pair<std::string, const MolecularZone*>& pair) const
41  { return *pair.second; }
42  };
43 
44  public:
45 
47  std::string GetProfileName() const { return fgProfileNameLookup[fProfileId]; }
48 
50  typedef boost::transform_iterator<InternalZoneFunctor,
53 
56  { return ZoneIterator(fZoneMap.begin()); }
57 
60  { return ZoneIterator(fZoneMap.end()); }
61 
62  private:
64 
65  //DV we have pointer data-members: prevent unintended copying
66  MolecularDB(const MolecularDB&);
68 
69  ~MolecularDB();
70 
71  std::vector<std::string> fMolecularIdStrings; // specifies the molecularId key for given time, software version, etc.
72 
73  MolecularIds::ProfileId fProfileId; // specifies profile_type variable in db
74 
75  static const std::string fgProfileNameLookup[MolecularIds::eLast+1];
76 
77  friend class Atmosphere;
78 
79  };
80 
81 } // namespace atm
82 
83 
84 #endif
85 
86 // Configure (x)emacs for this file ...
87 // Local Variables:
88 // mode: c++
89 // compile-command: "make -C .. -k"
90 // End:
Top of the interface to Atmosphere information.
boost::transform_iterator< InternalZoneFunctor, InternalZoneIterator, const MolecularZone & > ZoneIterator
ZoneIterator returns a pointer to a MolecularZone.
Definition: MolecularDB.h:52
const MolecularZone & operator()(const std::pair< std::string, const MolecularZone * > &pair) const
Definition: MolecularDB.h:40
std::vector< std::string > fMolecularIdStrings
Definition: MolecularDB.h:71
static const std::string fgProfileNameLookup[MolecularIds::eLast+1]
Definition: MolecularDB.h:75
InternalZoneMap::const_iterator InternalZoneIterator
Definition: MolecularDB.h:35
ZoneIterator ZonesEnd() const
End of the collection of valid Zones.
Definition: MolecularDB.h:59
Detector description interface for data in the Atm_Molecular database.
Definition: MolecularDB.h:29
MolecularDB & operator=(MolecularDB &)
ProfileId
Monitoring profiles:
Definition: MolecularIds.h:8
class describing a molecular zone.
Definition: MolecularZone.h:33
ZoneIterator ZonesBegin() const
Beginning of the collection of valid Zones.
Definition: MolecularDB.h:55
std::string GetProfileName() const
Return the name of profile type for this MolecularDB.
Definition: MolecularDB.h:47
MolecularIds::ProfileId fProfileId
Definition: MolecularDB.h:73
InternalZoneMap fZoneMap
Definition: MolecularDB.h:37
std::map< std::string, const MolecularZone * > InternalZoneMap
Definition: MolecularDB.h:34
MolecularDB(const MolecularIds::ProfileId id)
Definition: MolecularDB.cc:38

, generated on Tue Sep 26 2023.