Go up one levelGo to Previous Go to Next

HMS(3)

NAME

 
HMS - C++ class for working with H:M:S (hours minutes seconds) values

SYNOPSIS

 
#include "HMS.h"

class HMS {
public:
    HMS();
    HMS(int hours, int min, double sec);
    HMS(double val);

    int isNull() const;

    int hours() const;
    int min() const;
    double sec() const;
    double val() const;

    friend ostream& operator<<(ostream&, const HMS&);
    friend istream& operator>>(istream&, HMS&);

    friend int operator< (const HMS& a, const HMS& b);
    friend int operator<=(const HMS& a, const HMS& b);
    friend int operator> (const HMS& a, const HMS& b);
    friend int operator>=(const HMS& a, const HMS& b);
    friend int operator==(const HMS& a, const HMS& b);
    friend int operator!=(const HMS& a, const HMS& b);
};

DESCRIPTION

 
HMS is a simple class for representing values in Hours:Minutes:Seconds
format or in degrees, converting back and forth and comparing.

CONSTRUCTORS

 
HMS()
        Initialize a NULL H:M:S value (see isNull() method).

HMS(hours, min, sec)
        Initialize from hours, minutes and seconds.

HMS(val)
        Initialize from a value in degrees.

METHODS

 
isNull()
        Return true if the HMS object has the NULL value (created with
        default constructor).

hours()
min()
sec()
val()
        Return the parts of the H:M:S value or the value (val) in
        degrees.

operator<<(ostream, hms)
operator>>(istream, hms)
        I/O operators - using format H:M:S.sss.

operator< (a, b);
operator<=(a, b);
operator> (a, b);
operator>=(a, b);
operator==(a, b);
operator!=(a, b);
        Comparison operators - compare two H:M:S values.

SEE ALSO

 
WorldCoords
 


- - - - - -
Last change: 07 May 99

 


Go up one levelGo to Previous Go to Next

Please send questions or comments to abrighto@eso.org.
Copyright © 1998 ESO - European Southern Observatory