Began refactoring the entire source tree.
[aesalon.git] / src / monitor / program / Conductor.cpp
blob7286d7f7519dea823f7ef3cccfa43f00895bf1b8
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/program/Conductor.cpp
12 #include <iostream>
13 #include <stdio.h>
14 #include <unistd.h>
15 #include <errno.h>
17 #include "program/Conductor.h"
18 #include "Coordinator.h"
19 #include "common/StringTo.h"
20 #include "common/Config.h"
21 #include "common/StreamAsString.h"
22 #include "program/ZoneReader.h"
24 namespace Monitor {
25 namespace Program {
27 Conductor::Conductor(SharedMemory *sharedMemory, VCommunication::DataSink *dataSink)
28 : m_sharedMemory(sharedMemory), m_dataSink(dataSink) {
32 Conductor::~Conductor() {
36 void Conductor::run(Module::List *moduleList) {
37 std::list<ZoneReader *> readerList;
38 int readerCount = Common::StringTo<int>(Coordinator::instance()->vault()->get("zoneReaders"));
39 for(int i = 1; i < readerCount; i ++) {
40 ZoneReader *reader = new ZoneReader(m_sharedMemory, moduleList, m_dataSink);
41 reader->start();
42 readerList.push_back(reader);
44 ZoneReader reader(m_sharedMemory, moduleList, m_dataSink);
45 reader.startInThread();
46 std::cout << "exiting Conductor::run() . . ." << std::endl;
49 } // namespace Program
50 } // namespace Monitor