EpochHelper

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

NAME

EpochHelper −

SYNOPSIS

#include <acstimeEpochHelper.h>

Inherits TimeUtil.

Public Member Functions

EpochHelper (const acstime::Epoch &epoch)

EpochHelper ()

EpochHelper (long double MJDSeconds)

EpochHelper (const ACS::Time &value)

virtual ~EpochHelper ()

acstime::Epoch value ()

void value (const acstime::Epoch &epoch)

void value (const ACS::Time &epoch)

void value (long double MJDSeconds)

CORBA::ULong year ()

void year (const CORBA::ULong &)

CORBA::Long month ()

void month (const CORBA::Long &)

CORBA::Long day ()

void day (const CORBA::Long &)

CORBA::Long dayOfYear ()

void dayOfYear (const CORBA::Long &)

CORBA::ULong dayOfWeek ()

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::Long microSecond ()

void microSecond (const CORBA::Long &)

CORBA::Boolean normalize ()

void normalize (const CORBA::Boolean &)

void reset ()

acstime::TimeComparison compare (const acstime::Epoch &epoch)

CORBA::Boolean operator== (const acstime::Epoch &epoch) const

CORBA::Boolean operator<= (const acstime::Epoch &epoch) const

CORBA::Boolean operator< (const acstime::Epoch &epoch) const

CORBA::Boolean operator>= (const acstime::Epoch &epoch) const

CORBA::Boolean operator> (const acstime::Epoch &epoch) const

void add (const acstime::Duration &)

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

void subtract (const acstime::Duration &)

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

acstime::Duration difference (const acstime::Epoch &subtrahend)

void modulo (const acstime::Epoch &epoch)

EpochHelper & operator%= (const acstime::Epoch &epoch)

CORBA::Double toUTCdate (CORBA::Long array2TAI, CORBA::Long TAI2UTC)

long double toMJDseconds ()

CORBA::Double toJulianYear (CORBA::Long array2TAI, CORBA::Long TAI2UTC)

std::string toString (acstime::TimeSystem, const char *, const CORBA::Long array2TAI, const CORBA::Long TAI2UTC)

void fromString (acstime::TimeSystem, const char *)

Private Member Functions

void m_toValue (CORBA::Boolean booVal)

void m_toAttributes ()

long m_calcLeap ()

void m_almostUnix (std::ostringstream &)

void m_iso8601date (std::ostringstream &)

void m_iso8601full (std::ostringstream &)

void m_abbrevMonth (std::ostringstream &)

void m_abbrevWeekday (std::ostringstream &)

void m_microSec (std::ostringstream &, int)

EpochHelper (const EpochHelper &)

void operator= (const EpochHelper &)

Private Attributes

acstime::Epoch value_m

CORBA::ULong year_m

CORBA::Long month_m

CORBA::Long day_m

CORBA::Long day_mOfYear

CORBA::ULong dayOfWeek_m

CORBA::Long hour_m

CORBA::Long minute_m

CORBA::Long second_m

CORBA::Long microSecond_m

CORBA::Boolean normalize_m

Friends

DurationHelper * operator% (const EpochHelper &, const ACS::TimeInterval &)

DurationHelper * operator% (const ACS::TimeInterval &, const EpochHelper &)

Detailed Description

EpochHelper is derived from TimeUtil and provides the developer with an easy means of manipulating ACS Epochs (unique instance in time defined as a structure in acstime.idl).

TODO:

doxygen comments for private methods.

Constructor & Destructor Documentation

EpochHelper::EpochHelper (const acstime::Epoch & epoch) Constructor

Parameters:

epoch Epoch this helper class is based on.

EpochHelper::EpochHelper () Standard constructor

EpochHelper::EpochHelper (long double MJDSeconds) Constructor

Parameters:

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

EpochHelper::EpochHelper (const ACS::Time & value) Constructor

Parameters:

value Epoch in time this helper class is based on.

virtual EpochHelper::~EpochHelper () [inline, virtual] Destructor - nothing to delete!

EpochHelper::EpochHelper (const EpochHelper &) [private] copy not allowed

Member Function Documentation

void EpochHelper::add (const acstime::Duration &) Adds the given Duration to this Epoch.

Parameters:

duration Duration to be added

Exceptions:

ACSTimeError::OverflowOrUnderflowExImpl

acstime::TimeComparison EpochHelper::compare (const acstime::Epoch & epoch) Compares this Epoch with the given Epoch and returns the relation.

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

Parameters:

epoch Epoch to be compared

Returns:

The TimeComparison enumeration.

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

Parameters:

day

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

Returns:

day

CORBA::ULong EpochHelper::dayOfWeek () Returns the current value of the day of week.

Returns:

dayofweek

CORBA::Long EpochHelper::dayOfYear () Returns the current value of the day of year.

Returns:

dayofyear

void EpochHelper::dayOfYear (const CORBA::Long &) Sets the current value of the day of year.

Parameters:

dayofyear

acstime::Duration EpochHelper::difference (const acstime::Epoch & subtrahend) Subtracts the given Epoch from this Epoch and returns a Duration. result.

Notice the returned duration will be positive if the subtrahend is earlier than this, and negative if the subtrahend is later than this.

Parameters:

subtrahend this gets subtracted from this Epoch

Returns:

Duration between the two Epoch’s;

void EpochHelper::fromString (acstime::TimeSystem, const char *) Sets this Epoch’s value from the given string.

Parameters:

TimeSystem Time system to be used.
epoch
use this string to set object’s value

Exceptions:

ACSTimeError::ArgErrorExImpl

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

Returns:

hour

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

Parameters:

hour

void EpochHelper::m_abbrevMonth (std::ostringstream &) [private]

void EpochHelper::m_abbrevWeekday (std::ostringstream &) [private]

void EpochHelper::m_almostUnix (std::ostringstream &) [private]

long EpochHelper::m_calcLeap () [private]

void EpochHelper::m_iso8601date (std::ostringstream &) [private]

void EpochHelper::m_iso8601full (std::ostringstream &) [private]

void EpochHelper::m_microSec (std::ostringstream &, int) [private]

void EpochHelper::m_toAttributes () [private]

void EpochHelper::m_toValue (CORBA::Boolean booVal) [private] Exceptions:

ACSTimeError::OverflowOrUnderflowExImpl

void EpochHelper::microSecond (const CORBA::Long &) Sets the current value of the microsecond.

Parameters:

microsecond

CORBA::Long EpochHelper::microSecond () Returns the current value of the microsecond.

Returns:

microsecond

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

Returns:

minute

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

Parameters:

minute

void EpochHelper::modulo (const acstime::Epoch & epoch) Modulos this Epoch by the given Epoch.

Parameters:

epoch modulo epoch by this Epoch

void EpochHelper::month (const CORBA::Long &) Sets the current value of the month.

Parameters:

month

CORBA::Long EpochHelper::month () Returns the current value of the month.

Returns:

month

void EpochHelper::normalize (const CORBA::Boolean &) Set normalize or out-of-range flag.

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

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

For example, with normalize set true and setting the month,day to 3,32 will result in month,day 4,1. Setting hour,minute to 2,-62 will result in hour,minute 1,2.

This can be used as a convenient way of adding to or subtracting from an Epoch.

Parameters:

bool

CORBA::Boolean EpochHelper::normalize () Get normalize or out-of-range flag.

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

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

For example, with normalize set true and setting the month,day to 3,32 will result in month,day 4,1. Setting hour,minute to 2,-62 will result in hour,minute 1,2.

This can be used as a convenient way of adding to or subtracting from an Epoch.

Returns:

bool

EpochHelper& EpochHelper::operator%= (const acstime::Epoch & epoch) Modulos this Epoch by the given Epoch.

Parameters:

epoch modulo epoch by this Epoch

EpochHelper& EpochHelper::operator+= (const acstime::Duration & duration) Adds the given Duration to this Epoch.

Parameters:

duration Duration to be added

EpochHelper& EpochHelper::operator-= (const acstime::Duration & duration) Subtracts the given Duration from this Epoch.

Parameters:

duration Duration to be subtracted

CORBA::Boolean EpochHelper::operator< (const acstime::Epoch & epoch) const

CORBA::Boolean EpochHelper::operator<= (const acstime::Epoch & epoch) const

void EpochHelper::operator= (const EpochHelper &) [private] assignment not allowed

CORBA::Boolean EpochHelper::operator== (const acstime::Epoch & epoch) const

CORBA::Boolean EpochHelper::operator> (const acstime::Epoch & epoch) const

CORBA::Boolean EpochHelper::operator>= (const acstime::Epoch & epoch) const

void EpochHelper::reset () Sets all numeral attributes to zero, and normalize to FALSE. This facilities reuse of the object.

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

Parameters:

second

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

Returns:

second

void EpochHelper::subtract (const acstime::Duration &) Subtracts the given Duration from this Epoch.

Parameters:

duration Duration to be subtracted

Exceptions:

ACSTimeError::OverflowOrUnderflowExImpl

CORBA::Double EpochHelper::toJulianYear (CORBA::Long array2TAI, CORBA::Long TAI2UTC) Returns this Epoch’s value as the equivalent Julian year.

Note:

This method is especially designed to produce a result for use with the SLALIB library routine slaPm.

Parameters:

array2TAI Should be the array2TAI property in the Clock Component
TAI2UTC
Should be the TAI2UTC property in the Clock Component

Returns:

Julian year as double

long double EpochHelper::toMJDseconds () Returns this Epoch’s value as the equivalent modified Julian date in the form of fractional seconds.

Note:

This method was requested by CORR but there was no request to take the values of the array2TAI and TAI2UTC properties into account. Hence, this method does not require the two additional long parameters common to other methods of this class.

Returns:

The underlying acstime::Epoch of this helper class converted to Modified Julian Date in seconds (precision up to microseconds? ? ?).

std::string EpochHelper::toString (acstime::TimeSystem, const char *, const CORBA::Long array2TAI, const CORBA::Long TAI2UTC) Returns this Epoch’s value as a String.

Parameters:

TimeSystem Time system to be used.
format
format for the output string
array2TAI
Should be the array2TAI property in the Clock Component
TAI2UTC
Should be the TAI2UTC property in the Clock Component

Returns:

object’s value as equivalent string

Exceptions:

ACSTimeError::ArgErrorExImpl

CORBA::Double EpochHelper::toUTCdate (CORBA::Long array2TAI, CORBA::Long TAI2UTC) Returns this Epoch’s value as the equivalent UTC date and fractional day.

Note:

This method is especially designed to produce a result for use with the SLALIB library routines slaMappa and slaAoppat.

Parameters:

array2TAI Should be the array2TAI property in the Clock Component
TAI2UTC
Should be the TAI2UTC property in the Clock Component

Returns:

UTC date with fractional day as double

acstime::Epoch EpochHelper::value () Returns the current value of the Epoch.

Returns:

Epoch

void EpochHelper::value (long double MJDSeconds) Sets the current value of the Epoch.

Parameters:

Epoch

void EpochHelper::value (const ACS::Time & epoch) Sets the current value of the Epoch.

Parameters:

Epoch

void EpochHelper::value (const acstime::Epoch & epoch) Sets the current value of the Epoch.

Parameters:

Epoch

CORBA::ULong EpochHelper::year () Returns the current value of the year.

Returns:

year

void EpochHelper::year (const CORBA::ULong &) Sets the current value of the year.

Parameters:

year

Friends And Related Function Documentation

DurationHelper* operator% (const EpochHelper &, const ACS::TimeInterval &) [friend] Implemented this modulo operand to fulfill the requirements on an SPR from Correlator. Caller is responsible for deleting the DurationHelper allocated by this operand.

Parameters:

EpochHelper
TimeInterval

Returns:

Result of the modulo operand (EpochHelper.value().value % TimeInterval)

DurationHelper* operator% (const ACS::TimeInterval &, const EpochHelper &) [friend] Implemented this modulo operand to fulfill the requirements on an SPR from Correlator. Caller is responsible for deleting the DurationHelper allocated by this operand.

Parameters:

TimeInterval
EpochHelper

Returns:

Result of the modulo operand (TimeInterval % EpochHelper.value().value)

Member Data Documentation

CORBA::Long EpochHelper::day_m [private]

CORBA::Long EpochHelper::day_mOfYear [private]

CORBA::ULong EpochHelper::dayOfWeek_m [private]

CORBA::Long EpochHelper::hour_m [private]

CORBA::Long EpochHelper::microSecond_m [private]

CORBA::Long EpochHelper::minute_m [private]

CORBA::Long EpochHelper::month_m [private]

CORBA::Boolean EpochHelper::normalize_m [private]

CORBA::Long EpochHelper::second_m [private]

acstime::Epoch EpochHelper::value_m [private]

CORBA::ULong EpochHelper::year_m [private]

Author

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