TimeStamp.hh 1.86 KB
/**
 * TimeStamp.hh
 *
 *  Created on: Jan 18, 2013
 *      Author: AKKA IS
 */

#ifndef TIMESTAMP_HH_
#define TIMESTAMP_HH_

namespace AMDA {
namespace Parameters {

	/**
	 * @brief Time stamp of constructor file object
	 * @details must contain the last time of all file object which can modify the type of ParamData of Parameter
	 */
	class TimeStamp {
	public:
		/**
		 * @brief Default constructor
		 */
		TimeStamp():_time(0) {}

		/**
		 * @brief Constructor by param
		 */
		TimeStamp(const time_t &pTime):_time(pTime) {}

		/**
		 * @brief Constructor by copy
		 */
		TimeStamp(const TimeStamp &pTime):_time(pTime._time) {}

		/**
		 * @brief Comparison operator
		 */
		bool operator>(const TimeStamp &pTime) const { return _time > pTime._time;}

		/**
		 * @brief Comparison operator
		 */
		bool operator<(const TimeStamp &pTime) const { return _time < pTime._time;}

		/**
		 * @brief Comparison operator
		 */
		bool operator>=(const TimeStamp &pTime) const { return _time >= pTime._time;}

		/**
		 * @brief Comparison operator
		 */
		bool operator<=(const TimeStamp &pTime) const { return _time <= pTime._time;}

		/**
		 * @brief Comparison operator
		 */
		bool operator==(const TimeStamp &pTime) const { return _time == pTime._time;}

		/**
		 * @brief Comparison operator
		 */
		bool operator!=(const TimeStamp &pTime) const { return _time != pTime._time;}

		/**
		 * @brief setter operator
		 */
		TimeStamp &operator=(const time_t &pTime)  {  _time = pTime; return *this;}

		/**
		 * @brief copy operator
		 */
		TimeStamp &operator=(const TimeStamp &pTime) {  _time = pTime._time; return *this;}

	private:
		/**
		 * @brief time
		 * @details last time of all file object which can modify the type of ParamData of Parameter
		 * or 0 if there are no depend object
		 */
		time_t _time;
	};


} /* namespace Parameterss */
} /* namespace AMDA */
#endif /* TIMESTAMP_HH_ */