CONZEPT 16 C++ API
|
Point in time relative to midnight (00:00) of a day. More...
#include "C16/Value/Time.hpp"
Point in time relative to midnight (00:00) of a day.
Static Public Attributes | |
static const Time | EMPTY |
Empty time (00:00:00). More... | |
static const Time | MINIMUM |
Minimum time (00:00:00). More... | |
static const Time | MAXIMUM |
Maximum time (23:59:59.99). More... | |
Static Public Member Functions | |
static Time | now () |
Gets the current time (UTC) of the system. More... | |
static Time | now_local () |
Gets the current time of the local timezone of the system. More... | |
static bool | validate (int hours, int minutes, int seconds=0, int centiseconds=0) |
Validates a time by means of its hours, minutes, seconds and centiseconds since midnight (00:00). More... | |
static bool | validate (long int serial) |
Validates a time by means of its serial in units of centiseconds since midnight (00:00). More... | |
static void | validate_throw (int hours, int minutes, int seconds=0, int centiseconds=0) |
Validates a time by means of its hours, minutes, seconds and centiseconds since midnight (00:00). More... | |
static void | validate_throw (long int serial) |
Validates a time by means of its serial in units of centiseconds since midnight (00:00). More... | |
Public Member Functions | |
Time () | |
Constructs a zeroed time. More... | |
Time (bool empty) | |
Constructs a zeroed or an empty time. More... | |
Time (int hours, int minutes, int seconds=0, int centiseconds=0) | |
Constructs a time by means of its hours, minutes, seconds and centiseconds. More... | |
Time (long int serial) | |
Constructs a time by means of a serial in units of centiseconds since midnight (00:00). More... | |
Time (const Time &other) | |
Constructs a time by copying another time. More... | |
Time & | operator= (const Time &other) |
Assigns the time from another time. More... | |
int | compare (const Time &other) const |
Compares the time with another time. More... | |
bool | operator== (const Time &other) const |
Gets if the time is equal to another time. More... | |
bool | operator!= (const Time &other) const |
Gets if the time is unequal to another time. More... | |
bool | operator< (const Time &other) const |
Gets if the time is earlier than another time. More... | |
bool | operator<= (const Time &other) const |
Gets if the time is equal to or earlier than another time. More... | |
bool | operator>= (const Time &other) const |
Gets if the time is equal to or later than another time. More... | |
bool | operator> (const Time &other) const |
Gets if the time is later than another time. More... | |
bool | empty () const |
Gets if the time is empty. More... | |
int | hours () const |
Gets the hours of the time. More... | |
int | minutes () const |
Gets the minutes of the time since the last hour. More... | |
int | seconds () const |
Gets the seconds of the time since the last minute. More... | |
int | centiseconds () const |
Gets the centiseconds of the time since the last second. More... | |
int | milliseconds () const |
Gets the milliseconds of the time since the last second. More... | |
long int | serial () const |
Gets the serial of the time in units of centiseconds since midnight (00:00). More... | |
void | clear (bool empty=false) |
Zeros or empties the time. More... | |
void | assign (int hours, int minutes, int seconds=0, int centiseconds=0) |
Assigns the time by means of its hours, minutes, seconds and centiseconds since midnight (00:00). More... | |
void | assign (long int serial) |
Assigns the time by means of its serial in units of centiseconds since midnight (00:00). More... | |
|
static |
Empty time (00:00:00).
|
static |
Minimum time (00:00:00).
|
static |
Maximum time (23:59:59.99).
C16::Value::Time::Time | ( | ) |
Constructs a zeroed time.
|
explicit |
C16::Value::Time::Time | ( | int | hours, |
int | minutes, | ||
int | seconds = 0 , |
||
int | centiseconds = 0 |
||
) |
Constructs a time by means of its hours, minutes, seconds and centiseconds.
hours | Hours of the time (0 to 23) |
minutes | Minutes of the time since the last hour (0 to 59) |
seconds | Seconds of the time since the last minute (0 to 59) |
centiseconds | Centiseconds of the time since the last second (0 to 99) |
Exception::Invalidity | Hours invalid. |
Exception::Invalidity | Minutes invalid. |
Exception::Invalidity | Seconds invalid. |
Exception::Invalidity | Centiseconds invalid. |
|
explicit |
Constructs a time by means of a serial in units of centiseconds since midnight (00:00).
Exception::Invalidity | Serial invalid. |
C16::Value::Time::Time | ( | const Time & | other | ) |
Constructs a time by copying another time.
other | Another time |
|
static |
Gets the current time (UTC) of the system.
|
static |
Gets the current time of the local timezone of the system.
|
static |
Validates a time by means of its hours, minutes, seconds and centiseconds since midnight (00:00).
hours | Hours of the time (0 to 23) |
minutes | Minutes of the time since the last hour (0 to 59) |
seconds | Seconds of the time since the last minute (0 to 59) |
centiseconds | Centiseconds of the time since the last second (0 to 99) |
|
static |
|
static |
Validates a time by means of its hours, minutes, seconds and centiseconds since midnight (00:00).
hours | Hours of the time (0 to 23) |
minutes | Minutes of the time since the last hour (0 to 59) |
seconds | Seconds of the time since the last minute (0 to 59) |
centiseconds | Centiseconds of the time since the last second (0 to 99) |
Exception::Invalidity | Hours invalid. |
Exception::Invalidity | Minutes invalid. |
Exception::Invalidity | Seconds invalid. |
Exception::Invalidity | Centiseconds invalid. |
|
static |
Validates a time by means of its serial in units of centiseconds since midnight (00:00).
Exception::Invalidity | Serial invalid. |
Assigns the time from another time.
other | Another time |
int C16::Value::Time::compare | ( | const Time & | other | ) | const |
Compares the time with another time.
other | Another time |
0 | The time is equal to the other time. |
< 0 | The time is earlier than the other time. |
> 0 | The time is later than the other time. |
bool C16::Value::Time::operator== | ( | const Time & | other | ) | const |
Gets if the time is equal to another time.
other | Another time |
bool C16::Value::Time::operator!= | ( | const Time & | other | ) | const |
Gets if the time is unequal to another time.
other | Another time |
bool C16::Value::Time::operator< | ( | const Time & | other | ) | const |
Gets if the time is earlier than another time.
other | Another time |
bool C16::Value::Time::operator<= | ( | const Time & | other | ) | const |
Gets if the time is equal to or earlier than another time.
other | Another time |
bool C16::Value::Time::operator>= | ( | const Time & | other | ) | const |
Gets if the time is equal to or later than another time.
other | Another time |
bool C16::Value::Time::operator> | ( | const Time & | other | ) | const |
Gets if the time is later than another time.
other | Another time |
bool C16::Value::Time::empty | ( | ) | const |
Gets if the time is empty.
int C16::Value::Time::hours | ( | ) | const |
Gets the hours of the time.
0
if empty. int C16::Value::Time::minutes | ( | ) | const |
Gets the minutes of the time since the last hour.
0
if empty. int C16::Value::Time::seconds | ( | ) | const |
Gets the seconds of the time since the last minute.
0
if empty. int C16::Value::Time::centiseconds | ( | ) | const |
Gets the centiseconds of the time since the last second.
0
if empty. int C16::Value::Time::milliseconds | ( | ) | const |
Gets the milliseconds of the time since the last second.
0
if empty. long int C16::Value::Time::serial | ( | ) | const |
Gets the serial of the time in units of centiseconds since midnight (00:00).
0
if empty. void C16::Value::Time::clear | ( | bool | empty = false | ) |
void C16::Value::Time::assign | ( | int | hours, |
int | minutes, | ||
int | seconds = 0 , |
||
int | centiseconds = 0 |
||
) |
Assigns the time by means of its hours, minutes, seconds and centiseconds since midnight (00:00).
hours | Hours of the time (0 to 23) |
minutes | Minutes of the time since the last hour (0 to 59) |
seconds | Seconds of the time since the last minute (0 to 59) |
centiseconds | Centiseconds of the time since the last second (0 to 99) |
Exception::Invalidity | Hours invalid. |
Exception::Invalidity | Minutes invalid. |
Exception::Invalidity | Seconds invalid. |
Exception::Invalidity | Centiseconds invalid. |
void C16::Value::Time::assign | ( | long int | serial | ) |
Assigns the time by means of its serial in units of centiseconds since midnight (00:00).
Exception::Invalidity | Serial invalid. |