/* * ParamGetDDClient.hh * * Created on: 15 oct. 2012 * Author: casimir */ #ifndef PARAMGETDDCLIENT_HH_ #define PARAMGETDDCLIENT_HH_ #include #include #include #include "ParamGet.hh" #include "Pusher.hh" #include "TimeStamp.hh" namespace AMDA { // Needed classes declaration namespace DDServerInterface { class VirtualInstrument; typedef boost::shared_ptr VirtualInstrumentSPtr; namespace VI { class ParamFlow; typedef boost::shared_ptr ParamFlowSPtr; } } namespace Parameters { //used class class ParamData; typedef boost::shared_ptr ParamDataSPtr; /** * @class ParamGetDDBase * @brief It is a DataWriter for a Parameter get from DDServer. */ class ParamGetDDBase: public AMDA::Parameters::ParamGet_CRTP { public: typedef std::set InfoRequestList; ParamGetDDBase(Parameter ¶meter); ParamGetDDBase(const ParamGetDDBase &pParamGetDDBase, Parameter ¶meter); virtual ~ParamGetDDBase(); // Getter methods const std::string& getParName() const { return _parName; } const std::string& getViName() const { return _viName; } int getDim3Num() { return _dim3Num; } int getDim3CutIndex() { return _dim3CutIndex; } // Setter methods void setParName(const char* parName) { _parName = parName; } void setViName(const char* viName) { _viName = viName; } void setDim3Num(const int dim3Num) { _dim3Num = dim3Num; } void setDim3CutIndex(const int dim3CutIndex) { _dim3CutIndex = dim3CutIndex; } // Others methods /** * Prepares ::fillParamData to retrieve additional Information(s). */ void createInfoRequest(const char* pParamInfo) { _infoRequestList.insert(pParamInfo); } /** * Write data in dataParam. */ unsigned int write(); TimeStamp init(); /* * @overload DataWriter::getMinSampling */ virtual double getMinSampling(); /** * @override DataWriter::updateInfo update parameter info in relation to the ParamGet */ virtual void updateInfo(Parameter & parameter); protected: /** * Get Info if needed see _infoList. */ void getDDInfo(); private: /** * @brief update time in the ParamData * @details Must be call after createParamData */ void updateTimeInParamData(DD_data_t *data); /** * Create ParamData from getDataTypeInfo. */ void createParamData(); std::string _parName; /**< param name for current virtual instrument */ std::string _viName; /**< virtual instrument name */ int _dim3Num; int _dim3CutIndex; Base::Pusher* _pusher; /**< Responsible push data into the good container. */ InfoRequestList _infoRequestList; /**< List of additional information(s) needed. */ DDServerInterface::VirtualInstrumentSPtr _vi; /**< Virtual Instrument. */ DDServerInterface::VI::ParamFlowSPtr _paramFlow; /** Parameter data flow.*/ TimeStamp _timeStamp; /**< time of xml file or 0 */ }; typedef boost::shared_ptr ParamGetDDBaseSPtr; } /* namespace Parameters */ } /* namespace AMDA */ #endif /* PARAMGETDDCLIENT_HH_ */