/* * 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: TimestampCreator.hh * Author: Furkan - AKKA I&S * * Created on September 26, 2022, 4:14 PM */ #ifndef TIMESTAMPCREATOR_HH #define TIMESTAMPCREATOR_HH #include "ParamData.hh" #include "VisitorOfParamData.hh" #include "Timestamp_op.hh" namespace AMDA { namespace Parameters { class TimestampCreator : public VisitorOfParamData { public: TimestampCreator(Process &pProcess, ParamData ¶mInput, bool isTimeFrom, double timeFrom = 0.0) : _process(pProcess), _paramData(paramInput), _isTimeFrom(isTimeFrom), _timeFrom(timeFrom), _operation(NULL) { _paramData.accept(*this); } /** * @overload VisitorOfParamData::visit(ParamDataScalaireShort *) */ void visit(ParamDataScalaireShort *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataScalaireFloat *) */ void visit(ParamDataScalaireFloat *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataScalaireDouble *) */ void visit(ParamDataScalaireDouble *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataScalaireLongDouble *) */ void visit(ParamDataScalaireLongDouble *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataScalaireInt *) */ void visit(ParamDataScalaireInt *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataLogicalData *) */ void visit(ParamDataLogicalData *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataTab1DShort *) */ void visit(ParamDataTab1DShort *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataTab1DFloat *) */ void visit(ParamDataTab1DFloat *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataTab1DDouble *) */ void visit(ParamDataTab1DDouble *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataTab1DLongDouble *) */ void visit(ParamDataTab1DLongDouble *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataTab1DInt *) */ void visit(ParamDataTab1DInt *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataTab1DLogicalData *) */ void visit(ParamDataTab1DLogicalData *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataTab2DShort *) */ void visit(ParamDataTab2DShort *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataTab2DFloat *) */ void visit(ParamDataTab2DFloat *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataTab2DDouble *) */ void visit(ParamDataTab2DDouble *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataTab2DLongDouble *) */ void visit(ParamDataTab2DLongDouble *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataTab2DInt *) */ void visit(ParamDataTab2DInt *) { create(); } /** * @overload VisitorOfParamData::visit(ParamDataTab2DLogicalData *) */ void visit(ParamDataTab2DLogicalData *) { create(); } /** * @brief get the TimeShifted parameterized operation. */ Operation *getOperation() const { return _operation; } template void create() { _operation = new Timestamp_op(_process, dynamic_cast(_paramData), _isTimeFrom, _timeFrom); } private: Process &_process; ParamData &_paramData; bool _isTimeFrom; double _timeFrom; Operation *_operation; }; } } #endif /* TIMESTAMPCREATOR_HH */