SLIC
6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
src
Module.cc
Go to the documentation of this file.
1
// SLIC
2
#include "
Module.hh
"
3
#include "
ModuleRegistry.hh
"
4
5
namespace
slic
{
6
7
Module::Module
(
const
std::string&
name
,
bool
deleteOnExit,
bool
autoRegister) :
8
m_deleteOnExit(deleteOnExit) {
9
m_name
=
name
;
10
11
// If requested, register the module with the ModuleRegistry.
12
if
(autoRegister) {
13
ModuleRegistry::instance
()->registerModule(
this
);
14
}
15
16
// Create a logger for this module.
17
m_log
=
LogManager::instance
()->createLogWithMessenger(
m_name
,
LOG::okay
);
18
19
// Init message.
20
#ifdef SLIC_LOG
21
log
().
verbose
(
"Initialized module <"
+
getName
() +
">"
);
22
#endif
23
}
24
25
Module::~Module
() {
26
#ifdef SLIC_LOG
27
log
().
verbose
(
getName
() +
" is being deleted."
);
28
#endif
29
LogManager::instance
()->removeLog(
m_log
);
30
ModuleRegistry::instance
()->deregisterModule(
this
);
31
}
32
}
ModuleRegistry.hh
Module.hh
Singleton< ModuleRegistry >::instance
static ModuleRegistry * instance()
slic::LogStream::verbose
LogStream & verbose()
Definition:
LogStream.hh:238
slic::Module::~Module
virtual ~Module()
Definition:
Module.cc:25
slic::Module::getName
const std::string & getName() const
Definition:
Module.hh:54
slic::Module::Module
Module(const std::string &name, bool deleteOnExit=true, bool autoRegister=true)
Definition:
Module.cc:7
slic::Module::m_log
LogStream * m_log
Definition:
Module.hh:155
slic::Module::m_name
std::string m_name
Definition:
Module.hh:154
slic::Module::log
LogStream & log()
Definition:
Module.hh:99
LOG::okay
@ okay
Definition:
LogStream.hh:33
LOG::name
@ name
Definition:
LogStream.hh:26
slic
Definition:
CommandLineOption.hh:9
Generated by
1.9.1