Commit 23071c0c authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

resolved constructor resolution conflict

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 1466
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent e69668ff
/* this is <base_constr.cc>
* ----------------------------------------------------------------------------
*
* $Id: base_constr.cc,v 1.9 2004-01-30 14:42:20 tforb Exp $
* $Id: base_constr.cc,v 1.10 2004-02-02 09:28:45 tforb Exp $
*
* 09/08/2000 by Thomas Forbriger (IfG Stuttgart)
*
......@@ -14,6 +14,7 @@
* with system time library)
* 22/12/2003 V1.3 added function now()
* correction: month in struct tm is in (0,11)
* 02/02/2004 V1.4 moved conversion code double2time()
*
* ============================================================================
*/
......@@ -56,20 +57,20 @@ TAbsoluteTime now()
return(thetime);
} // now()
TRelativeTime::TRelativeTime(const double& seconds):
TBaseClassTime(0, 0, 0, 0, 0, 0, 0)
TRelativeTime double2time(const double& seconds)
{
time_kernel::time_Ts thetime_Ts;
double remain=seconds;
typedef long int li;
Mtime_Ts.second=li(seconds);
remain-=double(Mtime_Ts.second);
thetime_Ts.second=li(seconds);
remain-=double(thetime_Ts.second);
remain*=1.e3;
Mtime_Ts.milsec=li(remain);
remain-=double(Mtime_Ts.milsec);
thetime_Ts.milsec=li(remain);
remain-=double(thetime_Ts.milsec);
remain*=1.e3;
Mtime_Ts.micsec=li(remain);
norm();
} // TRelativeTime::TRelativeTime(const double& seconds)
thetime_Ts.micsec=li(remain);
return(TRelativeTime(thetime_Ts));
} // TRelativeTime double2time(const double& seconds)
double time2double(const TRelativeTime& rtime)
{
......
/* this is <libtime++.h>
* ----------------------------------------------------------------------------
*
* $Id: libtime++.h,v 2.12 2004-01-30 14:40:08 tforb Exp $
* $Id: libtime++.h,v 2.13 2004-02-02 09:28:44 tforb Exp $
*
* Copyright (c) by Thomas Forbriger (IfG Stuttgart)
*
......@@ -21,13 +21,16 @@
* 27/12/2003 V1.7 added member function of TAbsoluteTime to
* set doy explicitely
* 13/01/2004 V1.8 added constructor from double for TRelativeTime
* 02/02/2004 V1.9 constructor from double for TRelativeTime
* was highly ambiguous
* move conversion to doubel2time() function
*
* ============================================================================
*/
#ifndef TF_LIBTIME_H_
#define TF_LIBTIME_H_ \
"$Id: libtime++.h,v 2.12 2004-01-30 14:40:08 tforb Exp $";
"$Id: libtime++.h,v 2.13 2004-02-02 09:28:44 tforb Exp $";
#include <string>
#include "libtime.h"
......@@ -130,7 +133,6 @@ class TRelativeTime: public TBaseClassTime {
TRelativeTime(const long int &days=0, const long int &hour=0,
const long int &minute=0, const long int &second=0,
const long int &milsec=0, const long int &micsec=0);
explicit TRelativeTime(const double& seconds);
long int days() const;
void nfit(const TRelativeTime &delta, long int &n, TRelativeTime &full)
......@@ -437,8 +439,12 @@ inline TRelativeTime &TRelativeTime::operator= (char *timestring)
* some functions
* --------------
*/
//! return system time
TAbsoluteTime now();
//! convert relative time to seconds
double time2double(const TRelativeTime&);
//! convert seconds to relative time
TRelativeTime double2time(const double& seconds);
/*E*/
} // namespace libtime
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment