UniverseTypeAwareTime Class Reference

#include <orsa_units.h>

Inheritance diagram for UniverseTypeAwareTime:

Inheritance graph
[legend]
Collaboration diagram for UniverseTypeAwareTime:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 UniverseTypeAwareTime ()
 UniverseTypeAwareTime (const double)
 UniverseTypeAwareTime (const Date &)
 UniverseTypeAwareTime (const UniverseTypeAwareTime &)
double Time () const
double GetTime () const
Date GetDate () const
virtual void SetTime (const double)
virtual void SetTime (const Date &)
virtual void SetDate (const Date &)
virtual void SetTime (const UniverseTypeAwareTime &)
UniverseTypeAwareTimeoperator+= (const UniverseTypeAwareTimeStep &)
UniverseTypeAwareTimeoperator-= (const UniverseTypeAwareTimeStep &)
UniverseTypeAwareTimeStep operator- (const UniverseTypeAwareTime &) const
UniverseTypeAwareTime operator+ (const UniverseTypeAwareTimeStep &) const
UniverseTypeAwareTime operator- (const UniverseTypeAwareTimeStep &) const
bool operator== (const UniverseTypeAwareTime &) const
bool operator!= (const UniverseTypeAwareTime &) const
bool operator< (const UniverseTypeAwareTime &) const
bool operator> (const UniverseTypeAwareTime &) const
bool operator<= (const UniverseTypeAwareTime &) const
bool operator>= (const UniverseTypeAwareTime &) const

Protected Attributes

double time
Date date

Detailed Description

A Date like class which represents time as Date in Real Universes and as a double in Simulated Universes

Definition at line 431 of file orsa_units.h.


Constructor & Destructor Documentation

UniverseTypeAwareTime  ) 
 

Definition at line 1275 of file orsa_units.cc.

Referenced by UniverseTypeAwareTime::operator+(), and UniverseTypeAwareTime::operator-().

01275 { }     

UniverseTypeAwareTime const   double  ) 
 

Definition at line 1277 of file orsa_units.cc.

References UniverseTypeAwareTime::SetTime().

01277                                                              {
01278     SetTime(t);
01279   }

Here is the call graph for this function:

UniverseTypeAwareTime const Date  ) 
 

Definition at line 1281 of file orsa_units.cc.

References UniverseTypeAwareTime::SetTime().

01281                                                              {
01282     SetTime(d);
01283   }

Here is the call graph for this function:

UniverseTypeAwareTime const UniverseTypeAwareTime  ) 
 

Definition at line 1285 of file orsa_units.cc.

References UniverseTypeAwareTime::date, and UniverseTypeAwareTime::time.

01285                                                                               {
01286     date = t.date;
01287     time = t.time;
01288   }


Member Function Documentation

Date GetDate  )  const
 

Definition at line 1307 of file orsa_units.cc.

References UniverseTypeAwareTime::date.

Referenced by JPLPlanetsNewton::Acceleration(), Evolution::Integrate(), and orsa::StartFrame().

01307                                             {
01308     return (date);
01309   }

double GetTime  )  const
 

Definition at line 1290 of file orsa_units.cc.

References UniverseTypeAwareTime::date, Date::GetTime(), Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTime::time, and orsa::universe.

Referenced by orsa::PropagatedSky_J2000(), orsa::SetupSolarSystem(), and UniverseTypeAwareTime::Time().

01290                                               {
01291     double _t = 0.0;
01292     switch (universe->GetUniverseType()) {
01293     case Real:
01294       _t = date.GetTime();
01295       break;
01296     case Simulated:
01297       _t = time;
01298       break;
01299     }
01300     return _t;
01301   }

Here is the call graph for this function:

bool operator!= const UniverseTypeAwareTime  )  const
 

Definition at line 1494 of file orsa_units.cc.

01494                                                                                 {
01495     return (!((*this) == t));
01496   }

UniverseTypeAwareTime operator+ const UniverseTypeAwareTimeStep  )  const
 

Definition at line 1416 of file orsa_units.cc.

References UniverseTypeAwareTime::date, Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTime::time, orsa::universe, and UniverseTypeAwareTime::UniverseTypeAwareTime().

01416                                                                                                      {
01417     switch (universe->GetUniverseType()) {
01418     case Real:
01419       {
01420         UniverseTypeAwareTime _t(date);
01421         _t += ts;
01422         return _t;
01423       }
01424       break;
01425     case Simulated:
01426       {
01427         UniverseTypeAwareTime _t(time);
01428         _t += ts;
01429         return _t;
01430       }
01431       break;
01432     }
01433     return UniverseTypeAwareTime();
01434   }

Here is the call graph for this function:

UniverseTypeAwareTime & operator+= const UniverseTypeAwareTimeStep  ) 
 

Definition at line 1456 of file orsa_units.cc.

References UniverseTypeAwareTime::date, Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTime::time, and orsa::universe.

01456                                                                                                      {
01457     switch (universe->GetUniverseType()) {
01458     case Real:
01459       date += ts_in;
01460       break;
01461     case Simulated:
01462       time += ts_in.GetDouble();
01463       break;
01464     }
01465     return * this;
01466   }

Here is the call graph for this function:

UniverseTypeAwareTime operator- const UniverseTypeAwareTimeStep  )  const
 

Definition at line 1436 of file orsa_units.cc.

References UniverseTypeAwareTime::date, Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTime::time, orsa::universe, and UniverseTypeAwareTime::UniverseTypeAwareTime().

01436                                                                                                      {
01437     switch (universe->GetUniverseType()) {
01438     case Real:
01439       {
01440         UniverseTypeAwareTime _t(date);
01441         _t -= ts;
01442         return _t;
01443       }
01444       break;
01445     case Simulated:
01446       {
01447         UniverseTypeAwareTime _t(time);
01448         _t -= ts;
01449         return _t;
01450       }
01451       break;
01452     }
01453     return UniverseTypeAwareTime();
01454   }

Here is the call graph for this function:

UniverseTypeAwareTimeStep operator- const UniverseTypeAwareTime  )  const
 

Definition at line 1352 of file orsa_units.cc.

References UniverseTypeAwareTime::date, Date::GetTimeStep(), Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTime::time, and orsa::universe.

01352                                                                                                     {
01353     switch (universe->GetUniverseType()) {
01354     case Real:
01355       {
01356         UniverseTypeAwareTimeStep _ts(date.GetTimeStep());
01357         _ts -= t.GetDate().GetTimeStep();
01358         return _ts;
01359       }
01360       break;
01361     case Simulated:
01362       {
01363         UniverseTypeAwareTimeStep _ts(time);
01364         _ts -= t.Time();
01365         return _ts;
01366       }
01367       break;
01368     }
01369     return UniverseTypeAwareTimeStep();
01370   }

Here is the call graph for this function:

UniverseTypeAwareTime & operator-= const UniverseTypeAwareTimeStep  ) 
 

Definition at line 1468 of file orsa_units.cc.

References UniverseTypeAwareTime::date, Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTime::time, and orsa::universe.

01468                                                                                                      {
01469     switch (universe->GetUniverseType()) {
01470     case Real:
01471       date -= ts_in;
01472       break;
01473     case Simulated:
01474       time -= ts_in.GetDouble();
01475       break;
01476     }
01477     return * this;
01478   }

Here is the call graph for this function:

bool operator< const UniverseTypeAwareTime  )  const
 

Definition at line 1498 of file orsa_units.cc.

References UniverseTypeAwareTime::date, Date::GetTimeStep(), Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTime::time, and orsa::universe.

01498                                                                                {
01499     if (*this == t) return false;
01500     bool _z = false;
01501     switch (universe->GetUniverseType()) {
01502     case Real:
01503       if (date.GetTimeStep() < t.GetDate().GetTimeStep()) _z = true;
01504       break;
01505     case Simulated:
01506       if (time < t.time) _z = true;
01507       break;
01508     }
01509     return _z;
01510   }

Here is the call graph for this function:

bool operator<= const UniverseTypeAwareTime  )  const
 

Definition at line 1526 of file orsa_units.cc.

References UniverseTypeAwareTime::date, Date::GetTimeStep(), Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTime::time, and orsa::universe.

01526                                                                                 {
01527     bool _z = false;
01528     switch (universe->GetUniverseType()) {
01529     case Real:
01530       if (date.GetTimeStep() <= t.GetDate().GetTimeStep()) _z = true;
01531       break;
01532     case Simulated:
01533       if (time <= t.time) _z = true;
01534       break;
01535     }
01536     return _z;
01537   }

Here is the call graph for this function:

bool operator== const UniverseTypeAwareTime  )  const
 

Definition at line 1480 of file orsa_units.cc.

References UniverseTypeAwareTime::date, Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTime::time, and orsa::universe.

01480                                                                                 {
01481     bool _z = false;
01482     switch (universe->GetUniverseType()) {
01483     case Real:
01484       // if (date.GetTimeStep() == t.GetDate().GetTimeStep()) _z = true;
01485       if (date == t.GetDate()) _z = true;
01486       break;
01487     case Simulated:
01488       if (time == t.time) _z = true;
01489       break;
01490     }
01491     return _z;
01492   }

Here is the call graph for this function:

bool operator> const UniverseTypeAwareTime  )  const
 

Definition at line 1512 of file orsa_units.cc.

References UniverseTypeAwareTime::date, Date::GetTimeStep(), Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTime::time, and orsa::universe.

01512                                                                                {
01513     if (*this == t) return false;
01514     bool _z = false;
01515     switch (universe->GetUniverseType()) {
01516     case Real:
01517       if (date.GetTimeStep() > t.GetDate().GetTimeStep()) _z = true;
01518       break;
01519     case Simulated:
01520       if (time > t.time) _z = true;
01521       break;
01522     }
01523     return _z;
01524   }

Here is the call graph for this function:

bool operator>= const UniverseTypeAwareTime  )  const
 

Definition at line 1539 of file orsa_units.cc.

References UniverseTypeAwareTime::date, Date::GetTimeStep(), Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTime::time, and orsa::universe.

01539                                                                                 {
01540     bool _z = false;
01541     switch (universe->GetUniverseType()) {
01542     case Real:
01543       if (date.GetTimeStep() >= t.GetDate().GetTimeStep()) _z = true;
01544       break;
01545     case Simulated:
01546       if (time >= t.time) _z = true;
01547       break;
01548     }
01549     return _z;
01550   }

Here is the call graph for this function:

void SetDate const Date  )  [virtual]
 

Definition at line 1320 of file orsa_units.cc.

References UniverseTypeAwareTime::date, Date::GetTime(), and UniverseTypeAwareTime::time.

Referenced by orsa::PropagatedSky_J2000(), NEODYSCAT::Read(), JPLDastcomCometFile::Read(), JPLDastcomUnnumFile::Read(), JPLDastcomNumFile::Read(), AstDySMatrixFile::Read(), MPCCometFile::Read(), MPCOrbFile::Read(), AstorbFile::Read(), UniverseTypeAwareTime::SetTime(), and orsa::StartFrame().

01320                                                      {
01321     date = d;
01322     time = d.GetTime();
01323   }

Here is the call graph for this function:

void SetTime const UniverseTypeAwareTime  )  [virtual]
 

Definition at line 1325 of file orsa_units.cc.

References UniverseTypeAwareTime::date, and UniverseTypeAwareTime::time.

01325                                                                      {
01326     date = t.date;
01327     time = t.time;
01328   }

void SetTime const Date  )  [virtual]
 

Definition at line 1316 of file orsa_units.cc.

References UniverseTypeAwareTime::SetDate().

01316                                                     {
01317     SetDate(d);
01318   }

Here is the call graph for this function:

void SetTime const   double  )  [virtual]
 

Definition at line 1311 of file orsa_units.cc.

References UniverseTypeAwareTime::date, orsa::DAY, orsa::FromUnits(), Date::SetJulian(), and UniverseTypeAwareTime::time.

Referenced by Mercury5IntegrationFile::Read(), SWIFTFile::Read(), orsa::SearchCloseApproaches(), orsa::StartFrame(), DissipativeRungeKutta::Step(), RungeKutta::Step(), and UniverseTypeAwareTime::UniverseTypeAwareTime().

01311                                                      {
01312     date.SetJulian(FromUnits(t,DAY,-1));
01313     time = t;
01314   }

Here is the call graph for this function:

double Time  )  const
 

Definition at line 1303 of file orsa_units.cc.

References UniverseTypeAwareTime::GetTime().

Referenced by Evolution::Integrate(), OptimizedOrbitPositions::PropagatedOrbit(), JPLDastcomCometFile::Read(), MPCCometFile::Read(), OrbitWithEpoch::RelativePosVel(), and orsa::StartFrame().

01303                                            {
01304     return (GetTime());
01305   }

Here is the call graph for this function:


Member Data Documentation

Date date [protected]
 

Definition at line 471 of file orsa_units.h.

Referenced by UniverseTypeAwareTime::GetDate(), UniverseTypeAwareTime::GetTime(), UniverseTypeAwareTime::operator+(), UniverseTypeAwareTime::operator+=(), UniverseTypeAwareTime::operator-(), UniverseTypeAwareTime::operator-=(), UniverseTypeAwareTime::operator<(), UniverseTypeAwareTime::operator<=(), UniverseTypeAwareTime::operator==(), UniverseTypeAwareTime::operator>(), UniverseTypeAwareTime::operator>=(), UniverseTypeAwareTime::SetDate(), UniverseTypeAwareTime::SetTime(), and UniverseTypeAwareTime::UniverseTypeAwareTime().

double time [protected]
 

Definition at line 470 of file orsa_units.h.

Referenced by UniverseTypeAwareTime::GetTime(), UniverseTypeAwareTime::operator+(), UniverseTypeAwareTime::operator+=(), UniverseTypeAwareTime::operator-(), UniverseTypeAwareTime::operator-=(), UniverseTypeAwareTime::operator<(), UniverseTypeAwareTime::operator<=(), UniverseTypeAwareTime::operator==(), UniverseTypeAwareTime::operator>(), UniverseTypeAwareTime::operator>=(), UniverseTypeAwareTime::SetDate(), UniverseTypeAwareTime::SetTime(), and UniverseTypeAwareTime::UniverseTypeAwareTime().


The documentation for this class was generated from the following files:
Generated on Tue Jan 11 15:29:53 2005 for liborsa by  doxygen 1.4.0