![]() |
appkit
1.5.1
RoadNarrows Robotics Application Kit
|
Chronos - God of Time. More...
Classes | |
| class | Time |
| Time class. More... | |
Functions | |
| timespec | now () |
| Get the current time, indentified by CLOCK_REALTIME, since the last Epoch. More... | |
| int | now (timespec &ts) |
| Get the current time, indentified by CLOCK_REALTIME, since the last Epoch. More... | |
| double | toFp (const timespec &ts) |
| Convert timespec to floating point number equivalent. More... | |
| timespec | toTs (const double &t) |
| Convert floating point seconds to timespec equivalent. More... | |
| bool | isSet (const timespec &a) |
| Check if timespec is set. More... | |
| void | clear (timespec &ts) |
| Clear this object's time. More... | |
| timespec | add (const timespec &a, const timespec &b) |
| Add two timespecs. More... | |
| timespec | operator+ (const timespec &a, const timespec &b) |
| a + b More... | |
| timespec | sub (const timespec &a, const timespec &b) |
| Subtract two timespecs. More... | |
| timespec | operator- (const timespec &a, const timespec &b) |
| a - b More... | |
| timespec | normalize (const timespec &a) |
| Normalize the timespec. More... | |
| std::ostream & | operator<< (std::ostream &os, const Time &obj) |
| Time insertion operator. More... | |
Variables | |
| const long | MILLION = 1000000 |
| 1,000,000 | |
| const long long | BILLION = 1000000000 |
| 1,000,000,000 | |
Chronos - God of Time.
| timespec rnr::chronos::add | ( | const timespec & | a, |
| const timespec & | b | ||
| ) |
Add two timespecs.
a + b.
| a | Timespec a. |
| b | Timespec b. |
Definition at line 116 of file Time.cxx.
References normalize().
Referenced by operator+(), and rnr::chronos::Time::operator+=().
| void rnr::chronos::clear | ( | timespec & | ts | ) |
Clear this object's time.
| ts | Timespec. |
Definition at line 110 of file Time.cxx.
Referenced by rnr::chronos::Time::clear(), rnr::chronos::Time::getResolution(), now(), and rnr::chronos::Time::Time().
| bool rnr::chronos::isSet | ( | const timespec & | a | ) |
Check if timespec is set.
| ts | Timespec. |
Definition at line 105 of file Time.cxx.
Referenced by rnr::LogBook::Entry::empty(), and rnr::chronos::Time::isSet().
| timespec rnr::chronos::normalize | ( | const timespec & | a | ) |
| timespec rnr::chronos::now | ( | ) |
Get the current time, indentified by CLOCK_REALTIME, since the last Epoch.
Definition at line 70 of file Time.cxx.
References clear().
Referenced by rnr::LogBook::Entry::Entry(), rnr::chronos::Time::markNow(), and rnr::chronos::Time::now().
| int rnr::chronos::now | ( | timespec & | ts | ) |
|
inline |
a + b
| a | Timespec a. |
| b | Timespec b. |
Definition at line 140 of file Time.h.
|
inline |
a - b
| a | Timespec a. |
| b | Timespec b. |
Definition at line 165 of file Time.h.
References normalize(), and sub().
| std::ostream& rnr::chronos::operator<< | ( | std::ostream & | os, |
| const Time & | obj | ||
| ) |
Time insertion operator.
| os | Output stream. |
| obj | Object to insert. |
Referenced by rnr::chronos::Time::operator>().
| timespec rnr::chronos::sub | ( | const timespec & | a, |
| const timespec & | b | ||
| ) |
Subtract two timespecs.
a - b
| a | Timespec a. |
| b | Timespec b. |
Definition at line 126 of file Time.cxx.
References normalize().
Referenced by operator+(), operator-(), and rnr::chronos::Time::operator-=().
| double rnr::chronos::toFp | ( | const timespec & | ts | ) |
Convert timespec to floating point number equivalent.
| ts | Timespec. |
Definition at line 86 of file Time.cxx.
References BILLION.
Referenced by rnr::chronos::Time::getResolution(), rnr::chronos::Time::markNow(), rnr::chronos::Time::now(), rnr::chronos::Time::operator+=(), rnr::chronos::Time::operator-=(), rnr::chronos::Time::operator=(), and rnr::chronos::Time::Time().
| timespec rnr::chronos::toTs | ( | const double & | t | ) |
Convert floating point seconds to timespec equivalent.
| Seconds | and fractions of a second. |
Definition at line 91 of file Time.cxx.
References BILLION.
Referenced by rnr::chronos::Time::operator*=(), rnr::chronos::Time::operator+=(), rnr::chronos::Time::operator-=(), rnr::chronos::Time::operator=(), and rnr::chronos::Time::Time().