Successfully implemented a cpuTime marshaller.
[aesalon.git] / monitor / src / module / Loader.cpp
blob028c10c5feea6c8d1460df735af30c4d78e380af
1 /**
2 Aesalon, a tool to visualize a program's behaviour at run-time.
3 Copyright (C) 2010, Aesalon Development Team.
5 Aesalon is distributed under the terms of the GNU GPLv3. For more
6 licensing information, see the file LICENSE included with the distribution.
8 @file monitor/src/module/Loader.cpp
12 #include <iostream>
14 #include "module/Loader.h"
15 #include "config/ConcreteVault.h"
16 #include "Coordinator.h"
17 #include "common/StreamAsString.h"
19 namespace Monitor {
20 namespace Module {
22 ModuleID Loader::m_last = 0;
24 Loader::Loader() : m_moduleList(NULL) {
25 m_vault = Coordinator::instance()->vault();
26 m_moduleList = new List();
29 Loader::~Loader() {
33 void Loader::loadModules() {
34 std::vector<std::string> modules;
36 m_vault->get("::modules", modules);
38 for(std::vector<std::string>::iterator i = modules.begin(); i != modules.end(); ++i) {
39 loadModule(*i);
43 void Loader::loadModule(std::string name) {
44 Module *module = new Module(name);
45 m_vault->set(name + ":moduleID", Common::StreamAsString() << ++m_last);
46 m_moduleList->addModule(module);
49 } // namespace Module
50 } // namespace Monitor