3 #include <det/VManager.h>
4 #include <utl/Reader.h>
5 #include <utl/ErrorLogger.h>
6 #include <fwk/CentralConfig.h>
7 #include <utl/AugerException.h>
19 FindConfig(configLink);
20 fIsInitialized =
true;
25 VManager::FindConfig(
const string& configLink)
29 warn <<
"Attempt to initialize an already initialized manager: " << configLink;
34 fBranch = CentralConfig::GetInstance()->GetTopBranch(configLink);
38 err <<
'\'' << configLink <<
"' manager requested in the manager configuration but "
39 "the bootstrap file does not specify a configuration file for it.";
47 VManager::NotImplementedMessage(
const string& type,
48 const string& componentProperty,
49 const string& componentName)
52 return QueryInfoMessage(componentProperty, componentName) +
53 " for type " + type +
" not implemented in " + GetName() +
"!";
58 VManager::QueryInfoMessage(
const string& componentProperty,
59 const string& componentName,
63 os <<
"componentProperty = '" << componentProperty <<
"', "
64 "componentName = '" << componentName <<
"', "
66 IndexMap::const_iterator cIt = componentIndex.begin();
67 if (cIt != componentIndex.end()) {
68 os <<
" '" << cIt->first <<
"' => '" << cIt->second <<
'\'';
69 for (++cIt; cIt != componentIndex.end(); ++cIt)
70 os <<
" '" << cIt->first <<
"' => '" << cIt->second <<
'\'';
78 VManager::CanAnswer(
const Handle& returnData,
const string& component)
81 if (IsReportingErrors()) {
82 if (fAvailability.empty()) {
83 const string warn =
"The manager '" + GetName() +
"' has an empty list of "
84 "available types and components. This should not happen. The "
85 "RegisterTypesAndComponents() for known types and components should be called "
86 "in the ctor of the manager.";
92 const AvailabilityMap::const_iterator typeIt =
94 if (typeIt != fAvailability.end()) {
96 if (components.find(component) != components.end())
99 if (IsReportingErrors()) {
100 INFO(
string(
"Manager ") + GetName() +
" cannot answer request " +
101 QueryInfoMessage(returnData, component));
108 VManager::QueryInfoMessage(
const Handle& returnData,
109 const string& component)
112 os <<
"typeIdName = '" << returnData.
GetTypeIdName() <<
"', "
113 "component = '" << component <<
'\'';
119 VManager::QueryInfoMessage(
const Handle& returnData,
120 const string& component,
121 const string& property,
125 os << QueryInfoMessage(returnData, component) <<
", "
126 "property = '" <<
property <<
"', "
127 "componentIndex = {";
128 IndexMap::const_iterator cIt = componentIndex.begin();
129 if (cIt != componentIndex.end()) {
130 os <<
" '" << cIt->first <<
"' => '" << cIt->second <<
'\'';
131 for (++cIt; cIt != componentIndex.end(); ++cIt)
132 os <<
" '" << cIt->first <<
"' => '" << cIt->second <<
'\'';
#define INFO(message)
Macro for logging informational messages.
void Init()
Initialise the registry.
Exception for errors encountered when parsing XML.
std::string GetTypeIdName() const
#define WARNING(message)
Macro for logging warning messages.
std::set< std::string > ComponentSet
std::map< std::string, std::string > IndexMap
#define ERROR(message)
Macro for logging error messages.