DurationHelper

NAME
SYNOPSIS
Detailed Description
Constructor & Destructor Documentation
Member Function Documentation
Member Data Documentation
Author

NAME

DurationHelper −

SYNOPSIS

#include <acstimeDurationHelper.h>

Inherits TimeUtil.

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)

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

void subtract (const acstime::Duration &duration)

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

void modulo (const acstime::Duration &duration)

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

void multiply (const CORBA::ULong &multiplier)

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

void divide (const CORBA::ULong &divider)

DurationHelper & operator/= (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:

doxygen comments for private methods. These were taken directly from the Control subsystem without any modifications.

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

CORBA::Long DurationHelper::day () Returns the current value of the day.

Returns:

day

void DurationHelper::day (const CORBA::Long &) Sets the current value of the day.

Parameters:

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

CORBA::Long DurationHelper::hour () Returns the current value of the hour.

Returns:

hour

void DurationHelper::hour (const CORBA::Long &) Sets the current value of the hour.

Parameters:

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

CORBA::Long DurationHelper::minute () Returns the current value of the minute.

Returns:

minute

void DurationHelper::minute (const CORBA::Long &) Sets the current value of the minute.

Parameters:

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

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

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

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 CORBA::ULong & multiplier) Multiplies this Duration by the integer value.

Parameters:

multiplier multiply duration by this value

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.

CORBA::Long DurationHelper::second () Returns the current value of the second.

Returns:

second

void DurationHelper::second (const CORBA::Long &) Sets the current value of the second.

Parameters:

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

acstime::Duration DurationHelper::value () Returns the current value of the Duration.

Returns:

Duration

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

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]

Author

Generated automatically by Doxygen for ACS-2015.2 C++ API from the source code.