Program Listing for File timestamp_pos.hpp

Return to documentation for file (/tmp/ws/src/ecl_core/ecl_time/include/ecl/time/timestamp_pos.hpp)

/*****************************************************************************
** Ifdefs
*****************************************************************************/

#ifndef ECL_TIME_STAMP_POS_HPP_
#define ECL_TIME_STAMP_POS_HPP_

/*****************************************************************************
** Platform Check
*****************************************************************************/

#include <ecl/config.hpp>
#if defined(ECL_IS_POSIX)
#define ECL_HAS_TIMESTAMP

/*****************************************************************************
** Includes
*****************************************************************************/

#include <time.h>
#include <ecl/config/macros.hpp>
#include <ecl/config/portable_types.hpp>
#include <ecl/exceptions/macros.hpp>
#include <ecl/exceptions/standard_exception.hpp>
#include "timestamp_base.hpp"

/*****************************************************************************
** Namespaces
*****************************************************************************/

namespace ecl {

/*****************************************************************************
** Interface [Time]
*****************************************************************************/

class ecl_time_PUBLIC TimeStamp : public TimeStampBase {
public:
    /*********************
    ** Constructors
    **********************/
    TimeStamp();
    TimeStamp (const double& decimal_time_value);
    TimeStamp (const time_t &seconds, const long &nanoseconds);
    TimeStamp (const TimeStampBase& base);

    virtual ~TimeStamp() {}

    /******************************************
    ** Stamps
    *******************************************/
    using TimeStampBase::stamp;
    const TimeStamp& stamp();
#if defined(ECL_HAS_RT_TIMERS)
        static TimeStamp realtime_now();
#endif
};



} // namespace ecl

#ifdef ECL_HAS_EXCEPTIONS
namespace ecl {
namespace time {

ecl::StandardException throwTimeStampException(const char*loc);

} // namespace time
} // namespace ecl

#endif /* ECL_HAS_EXCEPTIONS */


#endif /* ECL_IS_POSIX */
#endif /* ECL_TIME_STAMP_POS_HPP_ */