Skip to content
Snippets Groups Projects
Commit cd59f8d6 authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

call prepare() for all Modules during server start up

parent d202c23e
No related branches found
No related tags found
No related merge requests found
......@@ -36,13 +36,14 @@ namespace ChimeraTK {
/** Destructor */
virtual ~Module();
/** Prepare the execution of the module. */
/** Prepare the execution of the module. This function is called before any module is started (including internal
* modules like FanOuts) and before the initial values of the variables are pushed into the queues. */
virtual void prepare() {};
/** Execute the module. */
virtual void run() {};
/** Terminate the module. Must be called before destruction, if run() was called previously. */
/** Terminate the module. Must/will be called before destruction, if run() was called previously. */
virtual void terminate() {};
/** Wait for receiving an update for any of the push-type variables in the group. Any poll-type variables are
......
......@@ -129,6 +129,11 @@ void Application::run() {
"Error: An instance of Application must have its applicationName set.");
}
// prepare the modules
for(auto &module : getSubmoduleListRecursive()) {
module->prepare();
}
// start the necessary threads for the FanOuts etc.
for(auto &internalModule : internalModuleList) {
internalModule->activate();
......@@ -148,6 +153,7 @@ void Application::run() {
for(auto &module : getSubmoduleListRecursive()) {
module->run();
}
}
/*********************************************************************************************************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment