A class to represent time duration with nano-second/micro-second resolution. More...
#include <TimeDuration.h>
Public Member Functions | |
AbstractData * | clone () const |
It returns a clone of this object. More... | |
DateTimeType | getDateTimeType () const |
It returns the subtype of the date and time type. More... | |
boost::int64_t | getFractionalSeconds () const |
It returns the fractional seconds. More... | |
long | getHours () const |
It returns the hours of a day - from 0 to 23. More... | |
long | getMinutes () const |
It returns the minutes of a hour - from 0 to 59. More... | |
long | getSeconds () const |
It returns the seconds of a minute - from 0 to 59. More... | |
const boost::posix_time::time_duration & | getTimeDuration () const |
It returns the boost time duration type. More... | |
boost::posix_time::time_duration & | getTimeDuration () |
It returns the boost time duration type. More... | |
int | getTypeCode () const |
It returns the data type code associated to date and time values: DATETIME_TYPE. More... | |
bool | operator!= (const DateTime &rhs) const |
Operator !=. More... | |
long | operator- (const TimeDuration &rhs) const |
Operator -. More... | |
bool | operator< (const DateTime &rhs) const |
Operator <. More... | |
bool | operator== (const DateTime &rhs) const |
Operator ==. More... | |
bool | operator> (const DateTime &rhs) const |
Operator <. More... | |
TimeDuration (long hours, long minutes, long seconds, boost::int64_t fracSeconds=0) | |
Constructor. More... | |
TimeDuration (boost::posix_time::time_duration &t) | |
Constructor. More... | |
std::string | toString () const |
It returns the time duration in the ISO textual format (hh:mm:ss,ss). More... | |
virtual | ~TimeDuration () |
Destructor. More... | |
Protected Attributes | |
boost::posix_time::time_duration | m_timeDuration |
The internal time duration information. More... | |
A class to represent time duration with nano-second/micro-second resolution.
A class to represent time duration with nano-second/micro-second resolution (hh:mm:ss,ss). Internally, it uses the datetime boost library to represent time duration, by using the data type boost::posix_time::time_duration.
Definition at line 51 of file TimeDuration.h.
te::dt::TimeDuration::TimeDuration | ( | long | hours, |
long | minutes, | ||
long | seconds, | ||
boost::int64_t | fracSeconds = 0 |
||
) |
Constructor.
hours | A number of hours of a day - from 0 to 23. |
minutes | A number of minutes of a hour - from 0 to 59. |
seconds | A number of seconds of a minute - from 0 to 59. |
fracSeconds | A fractional seconds. |
Definition at line 29 of file TimeDuration.cpp.
te::dt::TimeDuration::TimeDuration | ( | boost::posix_time::time_duration & | t | ) |
|
virtual |
Destructor.
Definition at line 82 of file TimeDuration.cpp.
|
virtual |
It returns a clone of this object.
Implements te::dt::AbstractData.
Definition at line 70 of file TimeDuration.cpp.
|
inlinevirtual |
It returns the subtype of the date and time type.
Implements te::dt::DateTime.
Definition at line 180 of file TimeDuration.h.
References te::dt::TIME_DURATION.
|
inline |
It returns the fractional seconds.
Definition at line 112 of file TimeDuration.h.
|
inline |
It returns the hours of a day - from 0 to 23.
Definition at line 91 of file TimeDuration.h.
Referenced by te::ogr::Transactor::add(), te::qt::widgets::TimeSliderWidget::eventFilter(), te::qt::widgets::TimeSliderWidget::getDateString(), te::ado::GetFormattedDateTime(), te::qt::widgets::TimeSliderWidget::initProperty(), te::qt::widgets::TimeSliderWidget::isSettingChanged(), te::qt::widgets::TimeSliderWidget::onApplyTimeIntervalPushButtonClicked(), te::qt::widgets::TimeSliderWidget::onResetFinalTimePushButtonClicked(), te::qt::widgets::TimeSliderWidget::onResetInitialTimePushButtonClicked(), te::qt::widgets::TimeSliderWidget::onSliderMoved(), te::qt::widgets::SliderPropertiesDialog::populateUi(), timeInstant2QDate(), and te::qt::widgets::TimeSliderWidget::updateTimeTextEdit().
|
inline |
It returns the minutes of a hour - from 0 to 59.
Definition at line 98 of file TimeDuration.h.
Referenced by te::ogr::Transactor::add(), te::qt::widgets::TimeSliderWidget::eventFilter(), te::qt::widgets::TimeSliderWidget::getDateString(), te::ado::GetFormattedDateTime(), te::qt::widgets::TimeSliderWidget::initProperty(), te::qt::widgets::TimeSliderWidget::isSettingChanged(), te::qt::widgets::TimeSliderWidget::onApplyTimeIntervalPushButtonClicked(), te::qt::widgets::TimeSliderWidget::onResetFinalTimePushButtonClicked(), te::qt::widgets::TimeSliderWidget::onResetInitialTimePushButtonClicked(), te::qt::widgets::TimeSliderWidget::onSliderMoved(), te::qt::widgets::SliderPropertiesDialog::populateUi(), timeInstant2QDate(), and te::qt::widgets::TimeSliderWidget::updateTimeTextEdit().
|
inline |
It returns the seconds of a minute - from 0 to 59.
Definition at line 105 of file TimeDuration.h.
Referenced by te::ogr::Transactor::add(), te::qt::widgets::TimeSliderWidget::eventFilter(), te::qt::widgets::TimeSliderWidget::getDateString(), te::ado::GetFormattedDateTime(), te::qt::widgets::TimeSliderWidget::initProperty(), te::qt::widgets::TimeSliderWidget::isSettingChanged(), te::qt::widgets::TimeSliderWidget::onApplyTimeIntervalPushButtonClicked(), te::qt::widgets::TimeSliderWidget::onResetFinalTimePushButtonClicked(), te::qt::widgets::TimeSliderWidget::onResetInitialTimePushButtonClicked(), te::qt::widgets::TimeSliderWidget::onSliderMoved(), te::qt::widgets::SliderPropertiesDialog::populateUi(), timeInstant2QDate(), and te::qt::widgets::TimeSliderWidget::updateTimeTextEdit().
|
inline |
It returns the boost time duration type.
Definition at line 77 of file TimeDuration.h.
|
inline |
It returns the boost time duration type.
Definition at line 84 of file TimeDuration.h.
|
inlinevirtualinherited |
It returns the data type code associated to date and time values: DATETIME_TYPE.
Implements te::dt::AbstractData.
Definition at line 103 of file DateTime.h.
References te::dt::DATETIME_TYPE.
|
virtual |
Operator !=.
rhs | The time duration to be compared. |
Implements te::dt::DateTime.
Definition at line 45 of file TimeDuration.cpp.
References m_timeDuration.
long te::dt::TimeDuration::operator- | ( | const TimeDuration & | rhs | ) | const |
Operator -.
rhs | The right-hand-side time instant. |
Definition at line 63 of file TimeDuration.cpp.
References m_timeDuration.
|
virtual |
Operator <.
rhs | The right-hand-side time duration to be compared. |
Implements te::dt::DateTime.
Definition at line 51 of file TimeDuration.cpp.
References m_timeDuration.
|
virtual |
Operator ==.
rhs | The time duration to be compared. |
Implements te::dt::DateTime.
Definition at line 39 of file TimeDuration.cpp.
References m_timeDuration.
|
virtual |
Operator <.
rhs | The right-hand-side time duration to be compared. |
Implements te::dt::DateTime.
Definition at line 57 of file TimeDuration.cpp.
References m_timeDuration.
|
virtual |
It returns the time duration in the ISO textual format (hh:mm:ss,ss).
Implements te::dt::AbstractData.
Definition at line 75 of file TimeDuration.cpp.
|
protected |
The internal time duration information.
Definition at line 189 of file TimeDuration.h.
Referenced by operator!=(), operator-(), operator<(), operator==(), and operator>().