/*
   HARK Library
   Copyright (C) 2021 Honda Research Institute Japan Inc.
 */

#if !defined(_HARKLIB_TIMEPOINT_H_INCLUDED_)
#define _HARKLIB_TIMEPOINT_H_INCLUDED_ 1

#include "hark-lib/hark-lib.h"
#include "hark-lib/object.h"

#include <sys/time.h>
#include <time.h>
#include <chrono>


namespace hark
{
    class Time: public object
    {
    public:
        std::chrono::system_clock::time_point time;

    public:
        Time();
        Time(std::chrono::system_clock::time_point &t);

        void setTime(std::chrono::system_clock::time_point &t);

        void setLocalTime();

        void printTime();
    };

    class TimeStamp: public object
    {
    public:
        struct timeval time;

    public:
        TimeStamp();
        TimeStamp(const TimeStamp &t);
        TimeStamp(const struct timeval &t);
        TimeStamp(const long int &sec, const long int &usec);

    public:
        void setTime(const TimeStamp &t);
        void setTime(const struct timeval &t);
        void setTime(const long int &sec, const long int &usec);

        void setLocalTime();

        void printTime();
    };
}

#endif /* #if !defined(_HARKLIB_TIMEPOINT_H_INCLUDED_) */

/* end of file */
