OCC Main Page | FoundationClasses | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

FoundationClasses
TKernel
Quantity


Quantity_Period Class Reference

Manages date intervals. For example, a Period object
gives the interval between two dates.
A period is expressed in seconds and microseconds.
.

#include <Quantity_Period.hxx>


Public Member Functions

void * operator new (size_t, void *anAddress)
void * operator new (size_t size)
void operator delete (void *anAddress)
Standard_EXPORT 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
.
Standard_EXPORT Quantity_Period (const Standard_Integer ss, const Standard_Integer mics=0)
 Creates a Period with a number of seconds and microseconds.
Exceptions
Quantity_PeriodDefinitionError:
- if the number of seconds expressed either by:
- dd days, hh hours, mn minutes and ss seconds, or
- Ss
is less than 0.
- if the number of microseconds expressed either by:
- mis milliseconds and mics microseconds, or
- Mics
is less than 0.
.
Standard_EXPORT 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
.
Standard_EXPORT 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
.
Standard_EXPORT 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
- with dd days, hh hours, mn minutes, ss
seconds, mis (defaulted to 0) milliseconds and
mics (defaulted to 0) microseconds; or
.
Standard_EXPORT void SetValues (const Standard_Integer ss, const Standard_Integer mics=0)
 Assigns to this period the time interval defined
- with Ss seconds and Mics (defaulted to 0) microseconds.
Exceptions
Quantity_PeriodDefinitionError:
- if the number of seconds expressed either by:
- dd days, hh hours, mn minutes and ss seconds, or
- Ss
is less than 0.
- if the number of microseconds expressed either by:
- mis milliseconds and mics microseconds, or
- Mics
is less than 0.
.
Standard_EXPORT 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
Standard_EXPORT Quantity_Period Add (const Quantity_Period &anOther) const
 Adds one Period to another one.
.
Quantity_Period operator+ (const Quantity_Period &anOther) const
Standard_EXPORT Standard_Boolean IsEqual (const Quantity_Period &anOther) const
 Returns TRUE if both <me> and <other> are equal.
.
Standard_Boolean operator== (const Quantity_Period &anOther) const
Standard_EXPORT Standard_Boolean IsShorter (const Quantity_Period &anOther) const
 Returns TRUE if <me> is shorter than <other>.
.
Standard_Boolean operator< (const Quantity_Period &anOther) const
Standard_EXPORT Standard_Boolean IsLonger (const Quantity_Period &anOther) const
 Returns TRUE if <me> is longer then <other>.
.
Standard_Boolean operator> (const Quantity_Period &anOther) const
 Quantity_Period ()
Standard_Integer _CSFDB_GetQuantity_PeriodmySec () const
void _CSFDB_SetQuantity_PeriodmySec (const Standard_Integer p)
Standard_Integer _CSFDB_GetQuantity_PeriodmyUSec () const
void _CSFDB_SetQuantity_PeriodmyUSec (const Standard_Integer p)

Static Public Member Functions

static Standard_EXPORT 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
.
static Standard_EXPORT 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
.

Private Attributes

Standard_Integer mySec
Standard_Integer myUSec

Friends

Standard_EXPORT friend Handle_Standard_Type & Quantity_Period_Type_ ()


Constructor & Destructor Documentation

Standard_EXPORT 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
 

Standard_EXPORT Quantity_Period::Quantity_Period const Standard_Integer  ss,
const Standard_Integer  mics = 0
 

Quantity_Period::Quantity_Period  )  [inline]
 


Member Function Documentation

Standard_Integer Quantity_Period::_CSFDB_GetQuantity_PeriodmySec  )  const [inline]
 

Standard_Integer Quantity_Period::_CSFDB_GetQuantity_PeriodmyUSec  )  const [inline]
 

void Quantity_Period::_CSFDB_SetQuantity_PeriodmySec const Standard_Integer  p  )  [inline]
 

void Quantity_Period::_CSFDB_SetQuantity_PeriodmyUSec const Standard_Integer  p  )  [inline]
 

Standard_EXPORT Quantity_Period Quantity_Period::Add const Quantity_Period anOther  )  const
 

Standard_EXPORT Standard_Boolean Quantity_Period::IsEqual const Quantity_Period anOther  )  const
 

Standard_EXPORT Standard_Boolean Quantity_Period::IsLonger const Quantity_Period anOther  )  const
 

Standard_EXPORT Standard_Boolean Quantity_Period::IsShorter const Quantity_Period anOther  )  const
 

static Standard_EXPORT Standard_Boolean Quantity_Period::IsValid const Standard_Integer  ss,
const Standard_Integer  mics = 0
[static]
 

static Standard_EXPORT Standard_Boolean Quantity_Period::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
[static]
 

void Quantity_Period::operator delete void *  anAddress  )  [inline]
 

void* Quantity_Period::operator new size_t  size  )  [inline]
 

void* Quantity_Period::operator new size_t  ,
void *  anAddress
[inline]
 

Quantity_Period Quantity_Period::operator+ const Quantity_Period anOther  )  const [inline]
 

Quantity_Period Quantity_Period::operator- const Quantity_Period anOther  )  const [inline]
 

Standard_Boolean Quantity_Period::operator< const Quantity_Period anOther  )  const [inline]
 

Standard_Boolean Quantity_Period::operator== const Quantity_Period anOther  )  const [inline]
 

Standard_Boolean Quantity_Period::operator> const Quantity_Period anOther  )  const [inline]
 

Standard_EXPORT void Quantity_Period::SetValues const Standard_Integer  ss,
const Standard_Integer  mics = 0
 

Standard_EXPORT 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
 

Standard_EXPORT Quantity_Period Quantity_Period::Subtract const Quantity_Period anOther  )  const
 

Standard_EXPORT void Quantity_Period::Values Standard_Integer ss,
Standard_Integer mics
const
 

Standard_EXPORT void Quantity_Period::Values Standard_Integer dd,
Standard_Integer hh,
Standard_Integer mn,
Standard_Integer ss,
Standard_Integer mis,
Standard_Integer mics
const
 


Friends And Related Function Documentation

Standard_EXPORT friend Handle_Standard_Type& Quantity_Period_Type_  )  [friend]
 


Field Documentation

Standard_Integer Quantity_Period::mySec [private]
 

Standard_Integer Quantity_Period::myUSec [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Aug 25 13:13:16 2008 for OpenCASCADE by  doxygen 1.4.1