From 5392fda9ff1d4d0cd96ecea6597751867c3861b8 Mon Sep 17 00:00:00 2001 From: randomdan Date: Thu, 3 May 2012 23:36:31 +0000 Subject: Hook in the new onConfigLoad component loader event --- project2/common/environment.cpp | 2 ++ project2/common/scriptLoader.cpp | 5 +++++ project2/common/scriptLoader.h | 1 + 3 files changed, 8 insertions(+) diff --git a/project2/common/environment.cpp b/project2/common/environment.cpp index 6010860..b13a1c0 100644 --- a/project2/common/environment.cpp +++ b/project2/common/environment.cpp @@ -84,6 +84,8 @@ Environment::init() BOOST_FOREACH(const ConfigsMap::value_type & c, configs) { c->loadInto(dcc); } + LoaderBase::onAllComponents(boost::bind(&ComponentLoader::onConfigLoad, _1)); + Logger()->clear(); if (clLevel >= 0) { Logger()->addLogger(LogDriverLoader::createNew("console", clLevel, std::string())); diff --git a/project2/common/scriptLoader.cpp b/project2/common/scriptLoader.cpp index 8237163..b13b3de 100644 --- a/project2/common/scriptLoader.cpp +++ b/project2/common/scriptLoader.cpp @@ -187,6 +187,11 @@ ComponentLoader::onPeriodic() { } +void +ComponentLoader::onConfigLoad() +{ +} + const Options * ComponentLoader::options() const { diff --git a/project2/common/scriptLoader.h b/project2/common/scriptLoader.h index 776d0c5..9f0e9c6 100644 --- a/project2/common/scriptLoader.h +++ b/project2/common/scriptLoader.h @@ -125,6 +125,7 @@ class ComponentLoader { virtual void onIdle(); // When the app engine goes idle virtual void onIteration(); // When the app engine has completed an iteration virtual void onPeriodic(); // When the app engine feels like it + virtual void onConfigLoad(); // When the environment reloads the configuration virtual const Options * options() const; // Options to be populated from the common config file/env/etc }; -- cgit v1.2.3