Call once after all setup has been done and before running.
187 l->info(
"loading config file {} ...",
filename);
198 if (! main_cfg.isNull()) {
199 for (
auto plugin :
get< vector<string> >(main_cfg,
"data.plugins")) {
200 l->info(
"config requests plugin: \"{}\"", plugin);
203 for (
auto app :
get< vector<string> >(main_cfg,
"data.apps")) {
204 l->info(
"config requests app: \"{}\"", app);
215 l->info(
"adding plugin: \"{}\"", plugin);
217 l->info(
"\t from library \"{}\"", lname);
219 pm.
add(pname, lname);
232 if (
c[
"type"].isNull()) {
233 l->critical(
"all configuration must have a type attribute, got: {}",
c);
236 string type = get<string>(
c,
"type");
237 string name = get<string>(
c,
"name");
238 l->info(
"constructing component: \"{}\":\"{}\"", type, name);
239 auto iface = Factory::lookup<Interface>(
type,
name);
242 l->info(
"constructing app: \"{}\"",c);
243 Factory::lookup_tn<IApplication>(
c);
249 string type = get<string>(
c,
"type");
250 string name = get<string>(
c,
"name");
251 l->info(
"configuring component: \"{}\":\"{}\"", type, name);
252 auto cfgobj = Factory::find_maybe<IConfigurable>(
type,
name);
260 cfg =
update(cfg, c[
"data"]);
261 cfgobj->configure(cfg);
std::vector< std::string > m_cfgfiles
Configuration update(Configuration &a, Configuration &b)
Merge dictionary b into a, return a.
boost::error_info< struct tag_errmsg, std::string > errmsg
std::pair< std::string, std::string > parse_pair(const std::string &in, const std::string &delim=":")
std::vector< std::string > m_plugins
Persist::externalvars_t m_extcode
static PluginManager & instance()
void extend(Configuration more)
Extend current list of configuration objects with more.
Configuration all() const
Return top-level, aggregate configuration.
std::vector< std::string > m_apps
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
Thrown when a wrong value has been encountered.
std::vector< std::string > m_load_path
int index(const std::string &type, const std::string &name="") const
std::string type(const T &t)
Json::Value Configuration
Plugin * add(const std::string &plugin_name, const std::string &libname="")
Add a plugin. If libname is not given, try to derive it.
Persist::externalvars_t m_extvars
Configuration pop(int ind)
Remove configuration at given index and return it.