/
InfoFileManager.cpp
67 lines (52 loc) · 1.43 KB
/
InfoFileManager.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "InfoFileManager.h"
#include "itextstream.h"
#include "module/StaticModule.h"
namespace map
{
void InfoFileManager::registerInfoFileModule(const IMapInfoFileModulePtr& module)
{
if (_modules.find(module) != _modules.end())
{
rWarning() << "Duplicate info file module registered: " << module->getName() << std::endl;
return;
}
_modules.insert(module);
}
void InfoFileManager::unregisterInfoFileModule(const IMapInfoFileModulePtr& module)
{
if (_modules.find(module) == _modules.end())
{
rWarning() << "Trying to unregister non-existent info file module: " << module->getName() << std::endl;
return;
}
_modules.erase(module);
}
void InfoFileManager::foreachModule(const std::function<void(IMapInfoFileModule&)>& functor)
{
for (const IMapInfoFileModulePtr& module : _modules)
{
functor(*module);
}
}
const std::string& InfoFileManager::getName() const
{
static std::string _name(MODULE_MAPINFOFILEMANAGER);
return _name;
}
const StringSet& InfoFileManager::getDependencies() const
{
static StringSet _dependencies;
return _dependencies;
}
void InfoFileManager::initialiseModule(const IApplicationContext& ctx)
{
rMessage() << getName() << "::initialiseModule called." << std::endl;
}
void InfoFileManager::shutdownModule()
{
rMessage() << getName() << "::shudownModule called." << std::endl;
_modules.clear();
}
// Define the static InfoFileManager module
module::StaticModule<InfoFileManager> infoFileManagerModule;
}