Blame view

src/ParamGetImpl/LocalFileInterface/ParamFlow.cc 1 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
/*
 * ParamFlow.cc
 *
 *  Created on: Nov 25, 2014
 *      Author: AKKA
 */

#include "VirtualInstrumentInterval.hh"
#include "ParamFlow.hh"

namespace AMDA {

namespace LocalFileInterface {

ParamFlow::ParamFlow(VirtualInstrumentInterval& pVI) :
		_vi(pVI)
{
}

ParamFlow::~ParamFlow()
{
}

LocalParamDataPacket* ParamFlow::get(std::string pParamId)
{
	//try to find param
	auto lIt = _paramInfoMap.find(pParamId);
	if (lIt == _paramInfoMap.end())
		return NULL;
	if (_paramInfoMap[pParamId] == nullptr)
		return NULL;
	if(_paramInfoMap[pParamId]->getPacketList().empty()) {
		_vi.getAsync().get();
	}
	return _paramInfoMap[pParamId]->getPacketList().pop();
}

bool ParamFlow::isTimeIntToProcessChanged(std::string pParamId) {
	return _vi.isTimeIntToProcessChanged() && _paramInfoMap[pParamId]->getPacketList().empty();
}

fa4b7852   Benjamin Renard   Fix bug around ti...
42
43
44
45
bool ParamFlow::isNoMoreTimeInt(std::string pParamId) {
	return _vi.isNoMoreTimeInt() && _paramInfoMap[pParamId]->getPacketList().empty();
}

fbe3c2bb   Benjamin Renard   First commit
46
47
} /* namespace LocalParamDataPacket */
} /* namespace AMDA */