Blame view

src/ExternLib/Cain/cainProcess.cc 1.53 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
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * 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) {
	  BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_PROCESS_ERR) << AMDA::ex_msg(std::string("cainProcess::init required at least 1 attribute")));
	}
            TimeStamp timeStamp = _parameterInput->init(this, _timeIntervalList);
            std::string ouputType= _attributList[0];
            CainCreator ICainCreator(*this, *_paramInput, ouputType);
            _operation = ICainCreator.getOperation();
            _paramData = ParamDataSPtr(_operation->getParamOutput());
            _paramData->setMinSampling(_paramInput->getMinSampling());
            return timeStamp;
        }
    }
}