head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.41; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.59; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.54.05; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.22.02; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# timestamp.hxx

Go to the documentation of this file.

    00001
    00006 // Written by Curtis Olson, started December 1998.
    00007 //
    00008 // Copyright (C) 1998  Curtis L. Olson  - curt@@flightgear.org
    00009 //
    00010 // This program is free software; you can redistribute it and/or
    00011 // modify it under the terms of the GNU General Public License as
    00012 // published by the Free Software Foundation; either version 2 of the
    00013 // License, or (at your option) any later version.
    00014 //
    00015 // This program is distributed in the hope that it will be useful, but
    00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
    00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00018 // General Public License for more details.
    00019 //
    00020 // You should have received a copy of the GNU General Public License
    00021 // along with this program; if not, write to the Free Software
    00022 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00023 //
    00024 // $Id: timestamp.hxx,v 1.5 2001/12/28 23:37:35 curt Exp $
    00025
    00026
    00027 #ifndef _TIMESTAMP_HXX
    00028 #define _TIMESTAMP_HXX
    00029
    00030
    00031 #ifndef __cplusplus
    00032 # error This library requires C++
    00033 #endif
    00034
    00035
    00036 #include <simgear/compiler.h>
    00037
    00038
    00039 // MSVC++ 6.0 kuldge - Need forward declaration of friends.
    00040 class SGTimeStamp;
    00041 SGTimeStamp operator + (const SGTimeStamp& t, const long& m);
    00042 long operator - (const SGTimeStamp& a, const SGTimeStamp& b);
    00043
    00054 class SGTimeStamp {
    00055
    00056 private:
    00057
    00058     long seconds;
    00059     long usec;
    00060
    00061 public:
    00062
    00064     SGTimeStamp();
    00065
    00073     SGTimeStamp( const long s, const long m );
    00074     ~SGTimeStamp();
    00075
    00077     void stamp();
    00078
    00080     SGTimeStamp& operator = ( const SGTimeStamp& t );
    00081
    00088     friend SGTimeStamp operator + (const SGTimeStamp& t, const long& m);
    00089
    00096     friend long operator - (const SGTimeStamp& a, const SGTimeStamp& b);
    00097
    00099     inline long get_seconds() const { return seconds; }
    00100
    00102     inline long get_usec() const { return usec; }
    00103 };
    00104
    00105 inline SGTimeStamp::SGTimeStamp() :
    00106     seconds(0),
    00107     usec(0)
    00108 {
    00109 }
    00110
    00111 inline SGTimeStamp::SGTimeStamp( const long s, const long u ) {
    00112     seconds = s;
    00113     usec = u;
    00114 }
    00115
    00116 inline SGTimeStamp::~SGTimeStamp() {
    00117 }
    00118
    00119 inline SGTimeStamp& SGTimeStamp::operator = (const SGTimeStamp& t)
    00120 {
    00121     seconds = t.seconds;
    00122     usec = t.usec;
    00123     return *this;
    00124 }
    00125
    00126
    00127 #endif // _TIMESTAMP_HXX
    00128
    00129

@ 1.3 log @Oops, try again. @ text @d100 1 a100 1