[OPUS]

Delta_time - A field object that represents a period of time.


Availability:

This class is available for the OPUS Blackboard API. The initial OPUS 2.0 release is described here

Constructors:
Delta_time( )
~Delta_time( )

Methods:
long( ) converts the time value to a long representation
assign( ) overrides the base class implementation in order to validate and assign the time string to the the object
clone( ) returns a copy of this object

Description

Time_entry objects contain either an Absolute_time or Delta_time field depending on which time blackboard (Absolute_time_bb or Relative_time_bb) they will be applied. Delta_time objects encapsulate a period of time that is compared to a timer whenever a Time_entry object containing this field is sent to the search method of an Relative_time_bb object.

Objects of this type can be instantiated in three ways: with a time_t value (seconds); with a string argument in the format DDD:HH:MM:SS where DDD is the number of days, HH is the number of hours[0-23], MM is the number of minutes[0-59], and SS is the number of seconds[0-61] in the time interval; and with no arguments which specifies a period of zero seconds.

Derived from

Field

See Also:


Delta_time::Delta_time - The Delta_time constructor.

Synopsis


Delta_time::Delta_time(
                       const time_t tm) // I - time in seconds

Delta_time::Delta_time(
                       const string& ts) // I - time string in the form
                                         //     DDD:HH:MM:SS

Delta_time::Delta_time(
                       const Delta_time& abt) // I - object to initialize
                                              //     from

Description

These methods construct a new Delta_time object initialized by the calling argument. String arguments must be in the form DDD:HH:MM:SS where DDD is the number of days, HH is the number of hours[0-23], MM is the number of minutes[0-59], and SS is the number of seconds[0-61] in the time period. If no argument is given, the object is initialized with zero.

Exceptions Thrown

Bad_val<string> - if the time string is invalid; Bad_val.arg contains the calling argument


Delta_time::~Delta_time - The Delta_time destructor.

Synopsis


Delta_time::~Delta_time()

Description

This method destroys the object.

Exceptions Thrown

none


Delta_time::assign - Set the object value to the value of the string representation.

Synopsis


void Delta_time::assign(
                        const string& s) // I - time embedded in string

Description

This method takes a string argument in the form DDD:HH:MM:SS where DDD is the number of days, HH is the number of hours[0-23], MM is the number of minutes[0-59], and SS is the number of seconds[0-61].

Exceptions Thrown

Bad_val<string> - if the time string is invalid; Bad_val.arg contains the calling argument


Delta_time::operator long() - Convert the internal time representation to a long integer representation.

Synopsis


Delta_time::operator long() const

Description

This method converts the internal time value into a long integer. At present, the long will contain the time interval in seconds, but OAPI clients should not rely on the long value representation as it may change in the future.

Returns

    A long integer representation of the Delta_time object time interval

in units of seconds.

Exceptions Thrown

none


Delta_time::clone - Create a copy of this object.

Synopsis


Field* Delta_time::clone() const

Description

This method creates a new Delta_time object, initialized by this object, off the heap and returns a pointer to the new object. The client should delete the returned object when it is no longer needed.

Returns

    A pointer to the new Delta_time object initialized by this object.

Exceptions Thrown

none


OPUS API index · STScI Home Page · Search · Topics · Index

Copyright © 1997-2000 The Association of Universities for Research in Astronomy, Inc. All Rights Reserved.


For more information, contact opushelp@stsci.edu

Last modified: 25 April 2000