cainProcess.cc 1.53 KB
/*
 * 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;
        }
    }
}