CModelsXMLManager.h
Go to the documentation of this file.
1 #ifndef _cdet_CModelsXMLManager_h_
2 #define _cdet_CModelsXMLManager_h_
3 
4 #include <map>
5 #include <string>
6 
7 #include <det/VManager.h>
8 #include <utl/ErrorLogger.h>
9 
10 
11 namespace utl {
12  class Reader;
13  class Branch;
14  class TabulatedFunction;
15 }
16 
17 namespace cdet {
18 
36 
37  public:
38  virtual ~CModelsXMLManager() { }
39 
40  void Init(const std::string& configLink);
41 
44  VMANAGER_GETDATA_CALL(InternalGetData, std::string)
45  VMANAGER_GETDATA_CALL(InternalGetData, std::vector<double>)
46  VMANAGER_GETDATA_CALL(InternalGetData, std::vector<int>)
47  VMANAGER_GETDATA_CALL(InternalGetData, std::vector<std::string>)
48  VMANAGER_GETDATA_CALL(InternalGetData, std::list<double>)
49  VMANAGER_GETDATA_CALL(InternalGetData, std::list<int>)
50  VMANAGER_GETDATA_CALL(InternalGetData, std::list<std::string>)
51 
64  Status GetData(utl::TabulatedFunction& returnData,
65  const std::string& componentProperty,
66  const std::string& componentName,
67  const IndexMap& componentIndex) const;
68 
69  VMANAGER_GETDATA_NOTFOUND(std::vector<bool>)
70  VMANAGER_GETDATA_NOTFOUND(std::vector<std::vector<int> >)
71  VMANAGER_GETDATA_NOTFOUND(std::map<std::string, double>)
72  VMANAGER_GETDATA_DENIED(std::list<std::pair<int, int> >)
73  VMANAGER_GETDATA_DENIED(std::map<int, utl::TabulatedFunction>)
74  VMANAGER_GETDATA_DENIED(utl::TabulatedFunctionComplexLgAmpPhase)
75  //VMANAGER_GETDATA_DENIED(unsigned long long int)
76 
77  private:
78  template<typename T>
79  Status InternalGetData(T& returnData,
80  const std::string& componentProperty,
81  const std::string& componentName,
82  const IndexMap& componentIndex) const;
83 
84  // Find Branch where the requested data resides
85  utl::Branch FindBranch(const std::string& property, const std::string& modelType,
86  const IndexMap& componentIndex) const;
87 
88  // Utility function to fill aforementioned maps
89  void FillMaps();
90 
91  // VMANAGER_GETDATA_HANDLE_DENIED
92  virtual
93  Status
94  GenericGetData(Handle& returnData,
95  const std::string& component,
96  const std::string& property,
97  const IndexMap& index) const;
98 
99 
100  // map Station Id to a map of model type, model id
101  // (map <Id, map<model type, model id>)
102 /*
103  typedef std::map<std::string, IndexMap> IndexIndexMap;
104  std::map<std::string, IndexIndexMap> fStationModelMap;
105  // map when <station id="all">
106  IndexIndexMap fAllStationsModelMap;
107 */
108  std::map<std::string, IndexMap> fStationModelMap;
109  // map when <station id="all">
111  };
112 
113 }
114 
115 
116 #endif
Status InternalGetData(T &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const
utl::Branch FindBranch(const std::string &property, const std::string &modelType, const IndexMap &componentIndex) const
std::map< std::string, IndexMap > fStationModelMap
Interface for detector managers.
Definition: VManager.h:115
#define VMANAGER_GETDATA_CALL(_GetData_, _T_...)
Definition: VManager.h:59
Status GetData(utl::TabulatedFunction &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const
#define VMANAGER_GETDATA_DENIED(_T_...)
Definition: VManager.h:21
void Init(const std::string &configLink)
Manager Initialization. configLink is the CentralConfig hook for the configuration file...
Manager for MARTA station description in XML &quot;model&quot; files.
std::map< std::string, std::string > IndexMap
Definition: VManager.h:133
virtual Status GenericGetData(Handle &returnData, const std::string &component, const std::string &property, const IndexMap &index) const
#define VMANAGER_GETDATA_NOTFOUND(_T_...)
Definition: VManager.h:41
Status
Specifies success or (eventually) various possible failure modes.
Definition: VManager.h:127

, generated on Tue Sep 26 2023.