Blame view

src/PostProcessing/PostProcessingAble.cc 1.12 KB
fbe3c2bb   Benjamin Renard   First commit
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
/*
 * PostProcessingAble.cc
 *
 *  Created on: 27 sept. 2013
 *      Author: CS
 */

#include "PostProcessingAble.hh"
#include "PostProcessing.hh"

namespace postprocessing {

PostProcessingAble::PostProcessingAble() {
}

PostProcessingAble::~PostProcessingAble() {
	std::vector<PostProcessing*>::const_iterator itr;
	for (itr = _postProcessingList.begin(); itr != _postProcessingList.end(); ++itr) {
		delete (*itr);
	}
}

/**
 * Lists output files.
 */
const std::vector<std::string>& PostProcessingAble::getOutputs() const {
	return _files;
}

/**
 * Gives post-processing result out directory.
 */
const std::string& PostProcessingAble::getDestination() const {
	// if empty means current directory
	return _outputDestination;
}

void PostProcessingAble::applyPostProcessing() {
	for (size_t i = 0; i < _postProcessingList.size(); ++i) {
		if(i > 0){
			_postProcessingList[i]->apply(_postProcessingList[i-1]);
		}
		else {
			_postProcessingList[i]->apply(this);
		}
	}
}

void PostProcessingAble::addPostProcessing(PostProcessing* pPostProcessing) {
		_postProcessingList.push_back(pPostProcessing);
	}

} /* namespace postprocessing */