Open CASCADE Technology
7.7.0
|
Manages date intervals. For example, a Period object gives the interval between two dates. A period is expressed in seconds and microseconds. More...
#include <Quantity_Period.hxx>
Public Member Functions | |
Quantity_Period (const Standard_Integer dd, const Standard_Integer hh, const Standard_Integer mn, const Standard_Integer ss, const Standard_Integer mis=0, const Standard_Integer mics=0) | |
Creates a Period With: 0 <= dd 0 <= hh 0 <= mn 0 <= ss 0 <= mis 0 <= mics. More... | |
Quantity_Period (const Standard_Integer ss, const Standard_Integer mics=0) | |
Creates a Period with a number of seconds and microseconds. Exceptions Quantity_PeriodDefinitionError: More... | |
void | Values (Standard_Integer &dd, Standard_Integer &hh, Standard_Integer &mn, Standard_Integer &ss, Standard_Integer &mis, Standard_Integer &mics) const |
Decomposes this period into a number of days,hours, minutes,seconds,milliseconds and microseconds Example of return values: 2 days, 15 hours, 0 minute , 0 second 0 millisecond and 0 microsecond. More... | |
void | Values (Standard_Integer &ss, Standard_Integer &mics) const |
Returns the number of seconds in Ss and the number of remainding microseconds in Mics of this period. Example of return values: 3600 seconds and 0 microseconds. More... | |
void | SetValues (const Standard_Integer dd, const Standard_Integer hh, const Standard_Integer mn, const Standard_Integer ss, const Standard_Integer mis=0, const Standard_Integer mics=0) |
Assigns to this period the time interval defined. More... | |
void | SetValues (const Standard_Integer ss, const Standard_Integer mics=0) |
Assigns to this period the time interval defined. More... | |
Quantity_Period | Subtract (const Quantity_Period &anOther) const |
Subtracts one Period from another and returns the difference. More... | |
Quantity_Period | operator- (const Quantity_Period &anOther) const |
Quantity_Period | Add (const Quantity_Period &anOther) const |
Adds one Period to another one. More... | |
Quantity_Period | operator+ (const Quantity_Period &anOther) const |
Standard_Boolean | IsEqual (const Quantity_Period &anOther) const |
Returns TRUE if both <me> and <other> are equal. More... | |
Standard_Boolean | operator== (const Quantity_Period &anOther) const |
Standard_Boolean | IsShorter (const Quantity_Period &anOther) const |
Returns TRUE if <me> is shorter than <other>. More... | |
Standard_Boolean | operator< (const Quantity_Period &anOther) const |
Standard_Boolean | IsLonger (const Quantity_Period &anOther) const |
Returns TRUE if <me> is longer then <other>. More... | |
Standard_Boolean | operator> (const Quantity_Period &anOther) const |
Static Public Member Functions | |
static Standard_Boolean | IsValid (const Standard_Integer dd, const Standard_Integer hh, const Standard_Integer mn, const Standard_Integer ss, const Standard_Integer mis=0, const Standard_Integer mics=0) |
Checks the validity of a Period in form (dd,hh,mn,ss,mil,mic) With: 0 <= dd 0 <= hh 0 <= mn 0 <= ss 0 <= mis 0 <= mics. More... | |
static Standard_Boolean | IsValid (const Standard_Integer ss, const Standard_Integer mics=0) |
Checks the validity of a Period in form (ss,mic) With: 0 <= ss 0 <= mics. More... | |
Manages date intervals. For example, a Period object gives the interval between two dates. A period is expressed in seconds and microseconds.
Quantity_Period::Quantity_Period | ( | const Standard_Integer | dd, |
const Standard_Integer | hh, | ||
const Standard_Integer | mn, | ||
const Standard_Integer | ss, | ||
const Standard_Integer | mis = 0 , |
||
const Standard_Integer | mics = 0 |
||
) |
Creates a Period With: 0 <= dd 0 <= hh 0 <= mn 0 <= ss 0 <= mis 0 <= mics.
Quantity_Period::Quantity_Period | ( | const Standard_Integer | ss, |
const Standard_Integer | mics = 0 |
||
) |
Creates a Period with a number of seconds and microseconds. Exceptions Quantity_PeriodDefinitionError:
Quantity_Period Quantity_Period::Add | ( | const Quantity_Period & | anOther | ) | const |
Adds one Period to another one.
Standard_Boolean Quantity_Period::IsEqual | ( | const Quantity_Period & | anOther | ) | const |
Returns TRUE if both <me> and <other> are equal.
Standard_Boolean Quantity_Period::IsLonger | ( | const Quantity_Period & | anOther | ) | const |
Returns TRUE if <me> is longer then <other>.
Standard_Boolean Quantity_Period::IsShorter | ( | const Quantity_Period & | anOther | ) | const |
Returns TRUE if <me> is shorter than <other>.
|
static |
Checks the validity of a Period in form (dd,hh,mn,ss,mil,mic) With: 0 <= dd 0 <= hh 0 <= mn 0 <= ss 0 <= mis 0 <= mics.
|
static |
Checks the validity of a Period in form (ss,mic) With: 0 <= ss 0 <= mics.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void Quantity_Period::SetValues | ( | const Standard_Integer | dd, |
const Standard_Integer | hh, | ||
const Standard_Integer | mn, | ||
const Standard_Integer | ss, | ||
const Standard_Integer | mis = 0 , |
||
const Standard_Integer | mics = 0 |
||
) |
Assigns to this period the time interval defined.
void Quantity_Period::SetValues | ( | const Standard_Integer | ss, |
const Standard_Integer | mics = 0 |
||
) |
Assigns to this period the time interval defined.
Quantity_Period Quantity_Period::Subtract | ( | const Quantity_Period & | anOther | ) | const |
Subtracts one Period from another and returns the difference.
void Quantity_Period::Values | ( | Standard_Integer & | dd, |
Standard_Integer & | hh, | ||
Standard_Integer & | mn, | ||
Standard_Integer & | ss, | ||
Standard_Integer & | mis, | ||
Standard_Integer & | mics | ||
) | const |
Decomposes this period into a number of days,hours, minutes,seconds,milliseconds and microseconds Example of return values: 2 days, 15 hours, 0 minute , 0 second 0 millisecond and 0 microsecond.
void Quantity_Period::Values | ( | Standard_Integer & | ss, |
Standard_Integer & | mics | ||
) | const |
Returns the number of seconds in Ss and the number of remainding microseconds in Mics of this period. Example of return values: 3600 seconds and 0 microseconds.