Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

DurationHelper Class Reference

#include <acstimeDurationHelper.h>

Inheritance diagram for DurationHelper:

Inheritance graph
[legend]
Collaboration diagram for DurationHelper:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DurationHelper (const acstime::Duration &duration)
 DurationHelper ()
 DurationHelper (long double seconds)
 DurationHelper (const ACS::TimeInterval &duration)
virtual ~DurationHelper ()
acstime::Duration value ()
void value (const acstime::Duration &duration)
void value (const ACS::TimeInterval &duration)
void value (long double seconds)
CORBA::Boolean positive ()
void positive (const CORBA::Boolean &)
CORBA::Long day ()
void day (const CORBA::Long &)
CORBA::Long hour ()
void hour (const CORBA::Long &)
CORBA::Long minute ()
void minute (const CORBA::Long &)
CORBA::Long second ()
void second (const CORBA::Long &)
CORBA::ULong microSecond ()
void microSecond (const CORBA::ULong &)
CORBA::Boolean normalize ()
void normalize (const CORBA::Boolean &)
void reset ()
acstime::TimeComparison compare (const acstime::Duration &duration)
CORBA::Boolean operator== (const acstime::Duration &duration) const
CORBA::Boolean operator<= (const acstime::Duration &duration) const
CORBA::Boolean operator< (const acstime::Duration &duration) const
CORBA::Boolean operator>= (const acstime::Duration &duration) const
CORBA::Boolean operator> (const acstime::Duration &duration) const
void add (const acstime::Duration &duration)
DurationHelperoperator+= (const acstime::Duration &duration)
void subtract (const acstime::Duration &duration)
DurationHelperoperator-= (const acstime::Duration &duration)
void modulo (const acstime::Duration &duration)
DurationHelperoperator%= (const acstime::Duration &duration)
void multiply (const CORBA::ULong &multiplier)
DurationHelperoperator *= (const CORBA::ULong &multiplier)
void divide (const CORBA::ULong &divider)
DurationHelperoperator/= (const CORBA::ULong &divider)
std::string toString (const char *format)
void fromString (const char *duration)
long double toSeconds ()

Private Member Functions

void m_toValue ()
void m_toAttributes ()
void m_microSec (std::ostringstream &)
 DurationHelper (const DurationHelper &)
void operator= (const DurationHelper &)

Private Attributes

acstime::Duration value_m
CORBA::Boolean positive_m
CORBA::Long day_m
CORBA::Long hour_m
CORBA::Long minute_m
CORBA::Long second_m
CORBA::ULong microSecond_m
CORBA::Boolean normalize_m

Detailed Description

DurationHelper is derived from TimeUtil and provides the developer with an easy means of manipulating Durations (difference in time between two epochs).

TODO:


Constructor & Destructor Documentation

DurationHelper::DurationHelper const acstime::Duration &  duration  ) 
 

Constructor

Parameters:
duration Duration this helper class will utilize.

DurationHelper::DurationHelper  ) 
 

Standard constructor

DurationHelper::DurationHelper long double  seconds  ) 
 

Constructor

Parameters:
MJDSeconds Modified Julian Date in seconds this helper class is based on.

DurationHelper::DurationHelper const ACS::TimeInterval duration  ) 
 

Constructor

Parameters:
duration Time interval this helper class will utilize.

virtual DurationHelper::~DurationHelper  )  [inline, virtual]
 

Destructor - nothing to delete!

DurationHelper::DurationHelper const DurationHelper  )  [private]
 

copy not allowed


Member Function Documentation

void DurationHelper::add const acstime::Duration &  duration  ) 
 

Adds the given Duration to this Duration.

Parameters:
duration Duration to be added
Exceptions:
ACSTimeError::OverflowOrUnderflowExImpl 

acstime::TimeComparison DurationHelper::compare const acstime::Duration &  duration  ) 
 

Compares this Duration with the given Duration and returns the relation.

DWF-should this be replaced completely by operators? ? ?

Parameters:
duration Duration to be compared

void DurationHelper::day const CORBA::Long  ) 
 

Sets the current value of the day.

Parameters:
day 

CORBA::Long DurationHelper::day  ) 
 

Returns the current value of the day.

Returns:
day

void DurationHelper::divide const CORBA::ULong divider  ) 
 

Divides this Duration by the given integer value.

Parameters:
divider divide duration by this value

void DurationHelper::fromString const char *  duration  ) 
 

Sets this Duration's value from the given String.

Parameters:
duration use this duration to set object's value
Exceptions:
ACSTimeError::ArgErrorExImpl 

void DurationHelper::hour const CORBA::Long  ) 
 

Sets the current value of the hour.

Parameters:
hour 

CORBA::Long DurationHelper::hour  ) 
 

Returns the current value of the hour.

Returns:
hour

void DurationHelper::m_microSec std::ostringstream &   )  [private]
 

void DurationHelper::m_toAttributes  )  [private]
 

void DurationHelper::m_toValue  )  [private]
 

Exceptions:
ACSTimeError::OverflowOrUnderflowExImpl 

void DurationHelper::microSecond const CORBA::ULong  ) 
 

Sets the current value of the microsecond.

Parameters:
microsecond 

CORBA::ULong DurationHelper::microSecond  ) 
 

Returns the current value of the microsecond.

Returns:
microsecond

void DurationHelper::minute const CORBA::Long  ) 
 

Sets the current value of the minute.

Parameters:
minute 

CORBA::Long DurationHelper::minute  ) 
 

Returns the current value of the minute.

Returns:
minute

void DurationHelper::modulo const acstime::Duration &  duration  ) 
 

Modulos this Duration by the given Duration.

Parameters:
duration modulo duration by this Duration

void DurationHelper::multiply const CORBA::ULong multiplier  ) 
 

Multiplies this Duration by the integer value.

Parameters:
multiplier multiply duration by this value
Exceptions:
ACSTimeError::OverflowOrUnderflowExImpl 

void DurationHelper::normalize const CORBA::Boolean  ) 
 

Sets the Normalize or out-of-range flag.

When this flag is set FALSE the interface causes an exception when any out-of-range attribute value is set. normalize is set to FALSE initially and after a reset().

When this flag is set TRUE the interface accepts out-of-range values for hour, minute, second, or microSecond. An out-of-range value causes all attributes to be normalized.

Parameters:
bool 

CORBA::Boolean DurationHelper::normalize  ) 
 

Returns the Normalize or out-of-range flag.

When this flag is set FALSE the interface causes an exception when any out-of-range attribute value is set. normalize is set to FALSE initially and after a reset().

When this flag is set TRUE the interface accepts out-of-range values for hour, minute, second, or microSecond. An out-of-range value causes all attributes to be normalized.

Returns:
bool

DurationHelper& DurationHelper::operator *= const CORBA::ULong multiplier  ) 
 

Multiplies this Duration by the integer value.

Parameters:
multiplier multiply duration by this value

DurationHelper& DurationHelper::operator%= const acstime::Duration &  duration  ) 
 

Modulos this Duration by the given Duration.

Parameters:
duration modulo duration by this Duration

DurationHelper& DurationHelper::operator+= const acstime::Duration &  duration  ) 
 

Adds the given Duration to this Duration.

Parameters:
duration Duration to be added

DurationHelper& DurationHelper::operator-= const acstime::Duration &  duration  ) 
 

Subtracts the given Duration from this Duration.

Parameters:
duration Duration to be subtracted

DurationHelper& DurationHelper::operator/= const CORBA::ULong divider  ) 
 

Divides this Duration by the given integer value.

Parameters:
divider divide duration by this value

CORBA::Boolean DurationHelper::operator< const acstime::Duration &  duration  )  const
 

CORBA::Boolean DurationHelper::operator<= const acstime::Duration &  duration  )  const
 

void DurationHelper::operator= const DurationHelper  )  [private]
 

assignment not allowed

CORBA::Boolean DurationHelper::operator== const acstime::Duration &  duration  )  const
 

CORBA::Boolean DurationHelper::operator> const acstime::Duration &  duration  )  const
 

CORBA::Boolean DurationHelper::operator>= const acstime::Duration &  duration  )  const
 

void DurationHelper::positive const CORBA::Boolean  ) 
 

Sets Duration's sign, TRUE => positive, FALSE => negative. positive is set TRUE initially and after a reset()..

Parameters:
bool 

CORBA::Boolean DurationHelper::positive  ) 
 

Returns Duration's sign, TRUE => positive, FALSE => negative. positive is set TRUE initially and after a reset().

Returns:
bool

void DurationHelper::reset  ) 
 

Sets all numeral attributes to zero, and normalize to FALSE. This facilities reuse of the object.


void DurationHelper::second const CORBA::Long  ) 
 

Sets the current value of the second.

Parameters:
second 

CORBA::Long DurationHelper::second  ) 
 

Returns the current value of the second.

Returns:
second

void DurationHelper::subtract const acstime::Duration &  duration  ) 
 

Subtracts the given Duration from this Duration.

Parameters:
duration Duration to be subtracted
Exceptions:
ACSTimeError::OverflowOrUnderflowExImpl 

long double DurationHelper::toSeconds  ) 
 

Returns this Duration's value as the equivalent value in seconds (fractional).

Note:
This method was requested by CORR but there was no request to take the values of the array2TAI and TAI2UTC properties into account.
Returns:
The underlying acstime::Duration of this helper class converted to seconds (precision up to microseconds? ? ?).

std::string DurationHelper::toString const char *  format  ) 
 

Returns this Duration's value as a String.

Parameters:
format format for the output string
Returns:
object's value as equivalent string
Exceptions:
ACSTimeError::ArgErrorExImpl 

void DurationHelper::value long double  seconds  ) 
 

Sets the current value of the Duration.

Parameters:
Duration 

void DurationHelper::value const ACS::TimeInterval duration  ) 
 

Sets the current value of the Duration.

Parameters:
Duration 

void DurationHelper::value const acstime::Duration &  duration  ) 
 

Sets the current value of the Duration.

Parameters:
Duration 

acstime::Duration DurationHelper::value  ) 
 

Returns the current value of the Duration.

Returns:
Duration


Member Data Documentation

CORBA::Long DurationHelper::day_m [private]
 

CORBA::Long DurationHelper::hour_m [private]
 

CORBA::ULong DurationHelper::microSecond_m [private]
 

CORBA::Long DurationHelper::minute_m [private]
 

CORBA::Boolean DurationHelper::normalize_m [private]
 

CORBA::Boolean DurationHelper::positive_m [private]
 

CORBA::Long DurationHelper::second_m [private]
 

acstime::Duration DurationHelper::value_m [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:36:23 2009 for ACS C++ API by doxygen 1.3.8