Blame view

src/ExternLib/Cain/cainProcess.cc 1.78 KB
a1ab0552   Hacene SI HADJ MOHAND   plugin added
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
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/* 
 * File:   cainProcess.cc
 * Author: hacene
 * 
 * Created on September 6, 2021, 11:14 AM
 */
#include "Operation.hh"
#include "ParameterManager.hh"
#include "ParameterCreatorFromExpression.hh"
#include "cainProcess.hh"
#include "CainCreator.hh"
#include <boost/lexical_cast.hpp>
#include "DicError.hh"
#include "AMDA_exception.hh"

namespace AMDA {
    namespace Parameters {

        cainProcess::cainProcess(Parameter& parameter) : SingleParamProcess_CRTP(parameter) {
        }

        cainProcess::cainProcess(const cainProcess& pProcess, Parameter &parameter) : SingleParamProcess_CRTP(pProcess, parameter) {
        }

        cainProcess::~cainProcess() {
        }

        TimeStamp cainProcess::init() {
            if (_attributList.size() < 1) {
6ba9e9fd   Hacene SI HADJ MOHAND   connection ok
36
37
38
                BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_PROCESS_ERR) << AMDA::ex_msg(std::string("cainProcess::init required at least 1 attribute")));
            }
            std::string ouputType = _attributList[0];
a1ab0552   Hacene SI HADJ MOHAND   plugin added
39
            TimeStamp timeStamp = _parameterInput->init(this, _timeIntervalList);
6ba9e9fd   Hacene SI HADJ MOHAND   connection ok
40
41
42
            Parameter::InfoList lInfoList = _parameterInput->getInfoList();
            _parameter.getInfoList().insert(lInfoList.begin(), lInfoList.end());
            _paramInput = _parameterInput->getParamData(this).get();
a1ab0552   Hacene SI HADJ MOHAND   plugin added
43
44
45
46
47
48
49
50
            CainCreator ICainCreator(*this, *_paramInput, ouputType);
            _operation = ICainCreator.getOperation();
            _paramData = ParamDataSPtr(_operation->getParamOutput());
            _paramData->setMinSampling(_paramInput->getMinSampling());
            return timeStamp;
        }
    }
}