/* * MultiParamProcess.hh * * Created on: Jan 4, 2013 * Author: f.casimir */ #ifndef MULTIPARAMPROCESS_HH_ #define MULTIPARAMPROCESS_HH_ #include #include #include #include #include "Process.hh" namespace AMDA { namespace Parameters { class TimeStamp; /** * abstract class to allow a process on multi parameter */ class MultiParamProcess: public Process { public: typedef std::map> ParameterList; MultiParamProcess(Parameter ¶meter); MultiParamProcess(const MultiParamProcess &pProcess, Parameter ¶meter); virtual ~MultiParamProcess(); ParameterList& getParameterList() { return _paramNameList; } /** * @brief Connection to Parameter server. * @overload DataClient::establishConnection() */ void establishConnection(); /** * @overload DataClient::init() */ virtual TimeStamp init(); /** * Write data in dataParam. */ 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 list of parameter name */ ParameterList _paramNameList; /** * @brief merge of paramDataIndexInfo of all parameter */ ParamDataIndexInfo _paramDataIndexInfo; /** * @brief minSampling of all paramInput */ double _minSampling; }; /** * @brief This CRTP class implements clone() for Derived */ template class MultiParamProcess_CRTP : public MultiParamProcess { public: /** * Default constructor */ MultiParamProcess_CRTP(Parameter ¶meter) : MultiParamProcess(parameter) {} /** * constructeur by copy */ MultiParamProcess_CRTP(const MultiParamProcess &pProcess, Parameter ¶meter) : MultiParamProcess(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 /* MULTIPARAMPROCESS_HH_ */