/* * SingleParamProcess.hh * * Created on: Feb 6, 2013 * Author: f.casimir */ #ifndef SINGLEPARAMPROCESS_HH_ #define SINGLEPARAMPROCESS_HH_ #include "Process.hh" namespace AMDA { namespace Parameters { class SingleParamProcess : public Process { public: SingleParamProcess(Parameter ¶meter); SingleParamProcess(const SingleParamProcess &pProcess, Parameter ¶meter); virtual ~SingleParamProcess(); // Overload DataClient methods /** * @overload DataClient::establishConnection() */ virtual void establishConnection(); /** * @overload Process::write() */ virtual unsigned int write(); /* * @brief @ to know the resampling strategy to use. If it's true, the nearest value will be use */ virtual bool useNearestValue(); /* * @overload DataWriter::getMinSampling */ virtual double getMinSampling(); /** * @overload DataWriter::updateInfo - update parameter info in relation to the process */ virtual void updateInfo(Parameter & parameter); protected: /** * @brief If the expression is not a Single parameter, * it must ask the creation of a parameter responsible of the formula calculation. */ virtual void parse(); /** * @brief It the server of the data to shift. */ ParameterSPtr _parameterInput; /** * @brief It is the channel of data to shift. */ ParamData * _paramInput; /** * @brief tag last data treatment */ bool _treatTerminated = false; /** * @brief */ bool _expressionParsed; }; /** * @brief This CRTP class implements clone() for Derived */ template class SingleParamProcess_CRTP : public SingleParamProcess { public: /** * Default constructor */ SingleParamProcess_CRTP(Parameter ¶meter) : SingleParamProcess(parameter) {} /** * constructeur by copy */ SingleParamProcess_CRTP(const SingleParamProcess &pProcess, Parameter ¶meter) : SingleParamProcess(pProcess, parameter) {} /** * clone an implementation of MultiParamProcess */ virtual DataWriter *clone(Parameter ¶meter) const { return new Derived(static_cast(*this),parameter); } }; } /* namespace Parameters */ } /* namespace AMDA */ #endif /* SINGLEPARAMPROCESS_HH_ */