7 #include <sigc++/slot.h> 57 Period(time_t seconds, uint32_t nanoseconds);
71 void SetPeriod(time_t sec, uint32_t nanosec);
79 const sigc::slot<const char*>*
istr()
const;
82 operator std::string()
const;
107 uint32_t nanoseconds;
110 const char* IStr()
const;
111 sigc::slot<const char*> slot;
134 Time(time_t time, uint32_t nanosec);
137 Time(
const std::string&);
155 void SetTime(time_t time, uint32_t nanosec);
163 operator std::string()
const;
202 static const int YEAR = 31536000;
206 static const int WEEK = 604800;
208 static const int DAY = 86400;
237 #endif // ARCLIB_TIME Arc namespace contains all core ARC classes.
Definition: ArcConfig.h:11
bool operator>=(const Period &) const
Comparing two Period objects.
std::string str(const TimeFormat &=time_format) const
Returns a string representation of the time, using the specified format.
Weeks.
Definition: DateTime.h:40
Period & operator=(time_t)
Assignment operator from a time_t.
Day, DD Mon YYYY HH:MM:SS GMT.
Definition: DateTime.h:25
static const int MONTH
Number of seconds in 30 days.
Definition: DateTime.h:204
Microseconds.
Definition: DateTime.h:34
void SetTime(time_t)
Sets the time.
Hours.
Definition: DateTime.h:38
static const int WEEK
Number of seconds in a week.
Definition: DateTime.h:206
bool operator>=(const Time &) const
Comparing two Time objects.
static const int YEAR
Number of seconds in a year (365 days)
Definition: DateTime.h:202
uint32_t GetPeriodNanoseconds() const
Gets the number of nanoseconds after the last whole second.
Time()
Default constructor. The time is put equal the current time.
Nanoseconds.
Definition: DateTime.h:33
bool operator>(const Time &) const
Comparing two Time objects.
YYYY-MM-DDTHH:MM:SS+HH:MM.
Definition: DateTime.h:23
A class for storing and manipulating times.
Definition: DateTime.h:125
bool operator==(const Time &) const
Comparing two Time objects.
Seconds.
Definition: DateTime.h:36
Period()
Default constructor. The period is set to 0 length.
Minutes.
Definition: DateTime.h:37
bool operator>(const Period &) const
Comparing two Period objects.
bool operator<(const Period &) const
Comparing two Period objects.
bool operator==(const Period &) const
Comparing two Period objects.
Time operator+(const Period &) const
Adding Time object with Period object.
static const int HOUR
Number of seconds in an hour.
Definition: DateTime.h:210
static TimeFormat GetFormat()
Gets the default format for time strings.
YYYY-MM-DD HH:MM:SS.mmmmmm (microseconds resolution)
Definition: DateTime.h:27
time_t GetTime() const
Gets the time in seconds.
Day Mon DD HH:MM:SS YYYY.
Definition: DateTime.h:21
YYYY-MM-DD HH:MM:SS.mmm (milliseconds resolution, suitable for Elasticsearch)
Definition: DateTime.h:28
TimeFormat
An enumeration that contains the possible textual time formats.
Definition: DateTime.h:19
const sigc::slot< const char * > * istr() const
For use with IString.
bool operator<=(const Time &) const
Comparing two Time objects.
static const time_t UNDEFINED
Undefined time.
Definition: DateTime.h:212
YYYYMMDDHHMMSSZ.
Definition: DateTime.h:20
1234567890
Definition: DateTime.h:26
std::ostream & operator<<(std::ostream &, const Period &)
Prints a Period-object to the given ostream – typically cout.
std::string TimeStamp(const TimeFormat &=Time::GetFormat())
Returns a time-stamp of the current time in some format.
static const int DAY
Number of seconds in a day.
Definition: DateTime.h:208
YYYY-MM-DDTHH:MM:SSZ.
Definition: DateTime.h:24
A Period represents a length of time.
Definition: DateTime.h:48
YYYY-MM-DD HH:MM:SS.
Definition: DateTime.h:22
bool operator<(const Time &) const
Comparing two Time objects.
Days.
Definition: DateTime.h:39
Milliseconds.
Definition: DateTime.h:35
uint32_t GetTimeNanoseconds() const
Gets the nanoseconds fraction of the time.
Time operator-(const Period &) const
Subtracting Period object from Time object.
PeriodBase
Base to use when constructing a new Period.
Definition: DateTime.h:32
void SetPeriod(time_t sec)
Sets the period in seconds.
Time & operator=(time_t)
Assignment operator from a time_t.
bool operator<=(const Period &) const
Comparing two Period objects.
static void SetFormat(const TimeFormat &)
Sets the default format for time strings.
time_t GetPeriod() const
Gets the period in seconds.
bool operator!=(const Time &) const
Comparing two Time objects.
bool operator!=(const Period &) const
Comparing two Period objects.