ParamFlow.cc
1 KB
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
/*
* 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();
}
bool ParamFlow::isNoMoreTimeInt(std::string pParamId) {
return _vi.isNoMoreTimeInt() && _paramInfoMap[pParamId]->getPacketList().empty();
}
} /* namespace LocalParamDataPacket */
} /* namespace AMDA */