Began implementing {Log,Network}Sink.
[aesalon.git] / monitor / src / module / List.cpp
blob89bc848b5c877f666d00c62185fad34722db2696
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/List.cpp
12 #include "module/List.h"
14 namespace Monitor {
15 namespace Module {
17 List::List() {
18 m_moduleList.push_back(NULL);
21 List::~List() {
25 void List::addModule(Module *module) {
26 m_moduleList.push_back(module);
29 Module *List::module(ModuleID id) {
30 if(id > m_moduleList.size()) return NULL;
31 return m_moduleList[id];
34 Module *List::module(std::string name) {
35 for(ModuleList::iterator i = m_moduleList.begin(); i != m_moduleList.end(); ++i) {
36 if((*i)->moduleName() == name) return *i;
38 return NULL;
41 } // namespace Module
42 } // namespace Monitor