![]() |
Open CASCADE Technology Reference Manual 8.0.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 int dd, const int hh, const int mn, const int ss, const int mis=0, const int mics=0) | |
| Creates a Period With: 0 <= dd 0 <= hh 0 <= mn 0 <= ss 0 <= mis 0 <= mics. | |
| Quantity_Period (const int ss, const int mics=0) | |
| Creates a Period with a number of seconds and microseconds. Exceptions Quantity_PeriodDefinitionError: | |
| void | Values (int &dd, int &hh, int &mn, int &ss, int &mis, int &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 | Values (int &ss, int &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. | |
| void | SetValues (const int dd, const int hh, const int mn, const int ss, const int mis=0, const int mics=0) |
| Assigns to this period the time interval defined. | |
| void | SetValues (const int ss, const int mics=0) |
| Assigns to this period the time interval defined. | |
| Quantity_Period | Subtract (const Quantity_Period &anOther) const |
| Subtracts one Period from another and returns the difference. | |
| Quantity_Period | operator- (const Quantity_Period &anOther) const |
| Quantity_Period | Add (const Quantity_Period &anOther) const |
| Adds one Period to another one. | |
| Quantity_Period | operator+ (const Quantity_Period &anOther) const |
| constexpr bool | IsEqual (const Quantity_Period &anOther) const noexcept |
| Returns TRUE if both <me> and <other> are equal. | |
| constexpr bool | operator== (const Quantity_Period &anOther) const noexcept |
| constexpr bool | IsShorter (const Quantity_Period &anOther) const noexcept |
| Returns TRUE if <me> is shorter than <other>. | |
| constexpr bool | operator< (const Quantity_Period &anOther) const noexcept |
| constexpr bool | IsLonger (const Quantity_Period &anOther) const noexcept |
| Returns TRUE if <me> is longer then <other>. | |
| constexpr bool | operator> (const Quantity_Period &anOther) const noexcept |
Static Public Member Functions | |
| static bool | IsValid (const int dd, const int hh, const int mn, const int ss, const int mis=0, const int 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. | |
| static bool | IsValid (const int ss, const int mics=0) |
| Checks the validity of a Period in form (ss,mic) With: 0 <= ss 0 <= mics. | |
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 int | dd, |
| const int | hh, | ||
| const int | mn, | ||
| const int | ss, | ||
| const int | mis = 0, | ||
| const int | mics = 0 ) |
Creates a Period With: 0 <= dd 0 <= hh 0 <= mn 0 <= ss 0 <= mis 0 <= mics.
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.
|
inlineconstexprnoexcept |
Returns TRUE if both <me> and <other> are equal.
|
inlineconstexprnoexcept |
Returns TRUE if <me> is longer then <other>.
|
inlineconstexprnoexcept |
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.
Checks the validity of a Period in form (ss,mic) With: 0 <= ss 0 <= mics.
|
inline |
|
inline |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
| void Quantity_Period::SetValues | ( | const int | dd, |
| const int | hh, | ||
| const int | mn, | ||
| const int | ss, | ||
| const int | mis = 0, | ||
| const int | mics = 0 ) |
Assigns to this period the time interval defined.
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 | ( | int & | dd, |
| int & | hh, | ||
| int & | mn, | ||
| int & | ss, | ||
| int & | mis, | ||
| int & | 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.
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.