#include <Time.hpp>
|
static Time | now () |
|
static Time | fromMicroseconds (int64_t value) |
|
static Time | fromMilliseconds (int64_t value) |
|
static Time | fromSeconds (int64_t value) |
|
static Time | fromSeconds (int value) |
|
static Time | fromSeconds (int64_t value, int microseconds) |
|
static Time | fromSeconds (double value) |
|
static Time | max () |
|
static Time | fromTimeValues (int year, int month, int day, int hour, int minute, int seconds, int millis, int micros) |
| Create time from int Time Values. Creates a time object from the time values (year, month, day ...) given as integer values. This function can be used when the time values are only available as seperated values in numerical form. More...
|
|
static Time | fromString (const std::string &stringTime, Resolution resolution=Microseconds, const std::string &mainFormat="%Y%m%d-%H:%M:%S") |
|
◆ Resolution
Enumerator |
---|
Seconds | |
Milliseconds | |
Microseconds | |
◆ Time()
◆ fromMicroseconds()
Time base::Time::fromMicroseconds |
( |
int64_t |
value | ) |
|
|
static |
◆ fromMilliseconds()
Time base::Time::fromMilliseconds |
( |
int64_t |
value | ) |
|
|
static |
◆ fromSeconds() [1/4]
Time base::Time::fromSeconds |
( |
int64_t |
value | ) |
|
|
static |
◆ fromSeconds() [2/4]
Time base::Time::fromSeconds |
( |
int |
value | ) |
|
|
static |
◆ fromSeconds() [3/4]
Time base::Time::fromSeconds |
( |
int64_t |
value, |
|
|
int |
microseconds |
|
) |
| |
|
static |
◆ fromSeconds() [4/4]
Time base::Time::fromSeconds |
( |
double |
value | ) |
|
|
static |
◆ fromString()
Create a time object from an input string, by default all parameters are set to convert the string returned by toString back to a Time object.
- Parameters
-
stringTime | String describing the time |
resolution | Set to a resolution higher than Secs if a (non-standard) msec or usec field is present, i.e. the non standard field is separated by ':' |
mainFormat | valid format for strptime, e.g."%Y%m%d-%H:%M:%S" which the given time string has |
- Exceptions
-
std::runtime_error | on failure such as a mismatching format |
◆ fromTimeValues()
Time base::Time::fromTimeValues |
( |
int |
year, |
|
|
int |
month, |
|
|
int |
day, |
|
|
int |
hour, |
|
|
int |
minute, |
|
|
int |
seconds, |
|
|
int |
millis, |
|
|
int |
micros |
|
) |
| |
|
static |
Create time from int Time Values. Creates a time object from the time values (year, month, day ...) given as integer values. This function can be used when the time values are only available as seperated values in numerical form.
- Parameters
-
year | The year as integer value. (should be 4 digits) |
month | The month of the year (1..12). |
day | Day of the month (1..31). |
hour | The hour of the day (since midnight 0..23). |
minute | The minutes after the hour (0..59). |
seconds | The seconds after the minute (0..59) |
millis | Milliseconds after the last second (0..999) |
micros | Microseconds additional to the milliseconds (0..999) |
- Returns
- a Time object generated from the parameters.
◆ isNull()
bool base::Time::isNull |
( |
| ) |
const |
True if this time is zero
◆ max()
Returns the maximum time value possible
◆ now()
◆ operator!=()
bool base::Time::operator!= |
( |
Time const & |
ts | ) |
const |
◆ operator*()
Time base::Time::operator* |
( |
double |
factor | ) |
const |
◆ operator+()
Time base::Time::operator+ |
( |
Time const & |
ts | ) |
const |
◆ operator-()
Time base::Time::operator- |
( |
Time const & |
ts | ) |
const |
◆ operator/()
Time base::Time::operator/ |
( |
int |
divider | ) |
const |
◆ operator<()
bool base::Time::operator< |
( |
Time const & |
ts | ) |
const |
◆ operator<=()
bool base::Time::operator<= |
( |
Time const & |
ts | ) |
const |
◆ operator==()
bool base::Time::operator== |
( |
Time const & |
ts | ) |
const |
◆ operator>()
bool base::Time::operator> |
( |
Time const & |
ts | ) |
const |
◆ operator>=()
bool base::Time::operator>= |
( |
Time const & |
ts | ) |
const |
◆ toMicroseconds()
int64_t base::Time::toMicroseconds |
( |
| ) |
const |
Returns this time as an integer number of microseconds
◆ toMilliseconds()
int64_t base::Time::toMilliseconds |
( |
| ) |
const |
Returns this time as an integer number of milliseconds (thus dropping the microseconds)
◆ toSeconds()
double base::Time::toSeconds |
( |
| ) |
const |
Returns this time as a fractional number of seconds
◆ toString()
Convert time into a string
- Parameters
-
resolution | Resolution which the string should present |
mainFormat | Main format to use – this is passed to strftime and appended by ':' plus the below seconds resolution if requested by the resolution argument |
◆ toTimeval()
timeval base::Time::toTimeval |
( |
| ) |
const |
Converts this time as a timeval object
◆ toTimeValues()
std::vector< int > base::Time::toTimeValues |
( |
| ) |
const |
◆ microseconds
int64_t base::Time::microseconds |
◆ UsecPerSec
const int base::Time::UsecPerSec = 1000000LL |
|
static |
The documentation for this struct was generated from the following files:
- /home/dfki.uni-bremen.de/roehr/workspace/2maz/dev/base/types/src/Time.hpp
- /home/dfki.uni-bremen.de/roehr/workspace/2maz/dev/base/types/src/Time.cpp