34#include <NDEVR/BaseValues.h>
35#include <NDEVR/ObjectInfo.h>
210 return m_time == time.m_time;
214 return m_time != time.m_time;
218 return m_time < time.m_time;
222 return m_time <= time.m_time;
226 return m_time > time.m_time;
230 return m_time >= time.m_time;
250 static tm getTime(
sint08 time,
bool use_local_time);
251 static uint08 MakeGMTFromLocal(
const tm& time);
252 static uint08 MakeLocalFromGMT(
const tm& time);
254 static constexpr uint02 s_epoch_year = 1970;
255 static constexpr uint02 s_tm_year_base = 1900;
256 static std::function<
uint08(
const tm& tm)> s_make_utc_from_local;
257 static std::function<
uint08(
const tm& tm)> s_make_local_from_utc;
258 static std::function<void(
const Exception& error)> s_clock_error_callback;
259 static sint08 s_nano_second_offset;
275 static const uint01 Dimensions = 0;
276 static const bool Vector =
false;
277 static const bool Primitive =
true;
278 static const bool Pointer =
false;
279 static const bool Unsigned =
false;
280 static const bool Float =
true;
281 static const bool Integer =
false;
282 static const bool Number =
true;
283 static const bool String =
false;
284 static const bool Color =
false;
285 static const bool Buffer =
false;
286 static const bool Boolean =
false;
290 static_assert(
sizeof(Time(0)) == 8,
"Bad time allocation size");
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
The core Color class in the NDEVR API. Colors can be defined in several ways. The ACIColor is compact...
Definition Color.h:41
Provides consistent interface to handle errors through the throw expression. All exceptions generated...
Definition Exception.hpp:47
Provides shared ownership of a dynamically allocated object.
Definition Pointer.hpp:71
The core String class for the NDEVR API.
Definition String.h:69
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
uint08 unixTime() const
Converts the timestamp to a UNIX time representation.
void setMonth(const uint01 &month, bool is_local_time)
Months
Enumerates the months of the year.
Definition Time.h:64
@ FEBRUARY
Definition Time.h:66
@ NOVEMBER
Definition Time.h:75
@ JANUARY
Definition Time.h:65
@ OCTOBER
Definition Time.h:74
@ DECEMBER
Definition Time.h:76
@ JUNE
Definition Time.h:70
@ MARCH
Definition Time.h:67
@ AUGUST
Definition Time.h:72
@ MAY
Definition Time.h:69
@ SEPTEMBER
Definition Time.h:73
@ JULY
Definition Time.h:71
@ APRIL
Definition Time.h:68
static constexpr uint08 SECOND
Definition Time.h:84
static constexpr uint08 LEAP_YEAR
Definition Time.h:90
Time(const String &time_string, bool is_local_time, const String &format_string)
Constructs a Time from a string representation. https://ndevr.org/time-patterns/.
static void SetClockErrorCallback(const std::function< void(const Exception &error)> &function)
uint08 leapYearConstant() const
uint01 minute(bool is_local_time) const
uint01 second(bool is_local_time) const
static void SetSystemTime(const Time &time)
Sets the application's system clock to a specified Time. Note: Does not affect OS Time.
bool operator!=(const Time &time) const
Definition Time.h:212
uint02 monthDay(bool is_local_time) const
void setTime(const uint08 &time)
Sets the internal timestamp.
uint02 millisecond() const
static void SetMakeLocalFromUTCFunction(const std::function< uint08(const tm &tm)> &function)
void setMinute(const uint01 &minute, bool is_local_time)
void setHour(const uint01 &hour, bool is_local_time)
uint02 yearDay(bool is_local_time) const
static constexpr uint08 WEEK
Definition Time.h:88
uint08 daysConstant() const
fltp08 julianDay(bool is_local_time) const
constexpr Time()
Default constructor initializing an invalid timestamp.
Definition Time.h:97
uint01 hour(bool is_local_time) const
Retrieves the hour component of the timestamp.
constexpr Time(const uint08 &time)
Constructor initializing the timestamp with a specific value.
Definition Time.h:104
uint02 month(bool is_local_time) const
Retrieves the month component of the timestamp.
void setSecond(const uint01 &second, bool is_local_time)
static constexpr uint08 NANOSECOND
Definition Time.h:81
constexpr uint08 getNanoSeconds() const
Gets the timestamp in nanoseconds.
Definition Time.h:185
static constexpr uint08 MINUTE
Definition Time.h:85
void setYear(const uint02 &year, bool is_local_time)
uint08 monthsConstant() const
bool operator>=(const Time &time) const
Definition Time.h:228
static constexpr uint08 MICROSECOND
Definition Time.h:82
Time(uint04 year, uint04 month, uint04 day, uint04 hour=0, uint04 minute=0, uint04 second=0, bool is_local_time=false)
Constructs a Time object using date and time components.
Time(const char *time_string, bool is_local_time, const String &format_string)
bool operator<(const Time &time) const
Definition Time.h:216
static constexpr uint08 DAY
Definition Time.h:87
String toString(bool get_local_time, const String &format_string) const
Converts the timestamp to a string representation. https://ndevr.org/time-patterns/.
bool operator>(const Time &time) const
Definition Time.h:224
static constexpr uint08 HOUR
Definition Time.h:86
void setTimeFromString(const String &time_string, bool is_local_time, const String &format_string)
Sets the time by converting the timestamp from a string representation. https://ndevr....
bool operator==(const Time &time) const
Definition Time.h:208
void setMillisecond(const uint02 &millisecond)
void setDayOfYear(const uint02 &day, bool is_local_time)
uint02 year(bool is_local_time) const
Retrieves the year component of the timestamp.
static void SetMakeUTCFromLocalFunction(const std::function< uint08(const tm &tm)> &function)
static Time SystemTime()
Retrieves the current system time.
static constexpr uint08 MILLISECOND
Definition Time.h:83
static constexpr uint08 YEAR
Definition Time.h:89
void setMonthDay(const uint01 &day, bool is_local_time)
bool operator<=(const Time &time) const
Definition Time.h:220
uint08 getMilliseconds() const
Gets the timestamp in milliseconds.
Definition Time.h:193
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
int64_t sint08
-Defines an alias representing an 8 byte, signed integer -Can represent exact integer values -9223372...
Definition BaseValues.hpp:71
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
Definition BaseValues.hpp:106
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
uint16_t uint02
-Defines an alias representing a 2 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:88
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
Information about the object.
Definition ObjectInfo.h:54