ParamGetConstant.hh 1.86 KB
/*
 * ParamGetConstant.hh
 *
 *  Created on: 18 sep 2018
 *      Author: AKKA
 */

#ifndef PARAMGETCONSTANT_HH_
#define PARAMGETCONSTANT_HH_

#include <set>
#include <string>

#include <boost/shared_ptr.hpp>

#include "ParamGet.hh"

#include "TimeStamp.hh"

#include "ConstantParamData.hh"

#include "Pusher.hh"

using namespace AMDA::Parameters;

namespace AMDA {

namespace ConstantInterface {

//used class
class ParamData;

/**
 * @class ParamGetConstant
 * @brief It is a DataWriter for a constant Parameter get.
 */
class ParamGetConstant: public ParamGet_CRTP<ParamGetConstant>
{
public:
	/*
	 * @brief Constructor
	 */
	ParamGetConstant(Parameter &parameter);

	ParamGetConstant(const ParamGetConstant &pParamGetConstant, Parameter &parameter);

	/*
	 * @brief Destructor
	 */
	virtual ~ParamGetConstant();

	/**
	 *  @overload DataWriter::write - Write data in dataParam and return the number of data writed.
	 */
	virtual unsigned int write();

	/*
	 * @overload DataWriter::getMinSampling
	 */
	virtual double getMinSampling();

	/*
	 * @brief Init
	 */
	TimeStamp init();

	/**
	 * @overload DataWriter::updateInfo update parameter info in relation to the ParamGet
	 */
	virtual void updateInfo(Parameter & parameter);

	void setSampling(double sampling) {
		_sampling = sampling;
	}

	void setType(ConstantParamType type) {
		_type = type;
	}

	void setValue(double value) {
		_value = value;
	}

	void setDim1(int dim1) {
		_dim1 = dim1;
	}

	void setDim2(int dim2) {
		_dim2 = dim2;
	}

protected:
	double _sampling;

	ConstantParamType _type;

	ConstantContainerType _container;

	double _value;

	int _dim1;

	int _dim2;

	TimeIntervalList::iterator _currentInterval;

	/*
	 * @brief Data pusher
	 */
	PusherBase *_pusher;
};

typedef boost::shared_ptr<ParamGetConstant> ParamGetConstantSPtr;

} /* namespace ConstantInterface */
} /* namespace AMDA */
#endif /* PARAMGETCONSTANT_HH_ */