MVEpoch.h
Classes
- MVEpoch -- A class for high precision time (full description)
Interface
- Public Members
- MVEpoch()
- MVEpoch(const MVEpoch &other)
- MVEpoch(Double inday, Double infrac=0)
- MVEpoch(const Vector<Double> &inday)
- MVEpoch(const Quantity &in)
- MVEpoch(const Quantity &in1, const Quantity &in2)
- MVEpoch(const Quantum<Vector<Double> > &in)
- MVEpoch(const Vector<Quantity> &in)
- ~MVEpoch()
- MVEpoch &operator=(const MVEpoch &other)
- MVEpoch &operator+=(const MVEpoch &other)
- MVEpoch operator+(const MVEpoch &other) const
- MVEpoch &operator-=(const MVEpoch &other)
- MVEpoch operator-(const MVEpoch &other) const
- Bool operator==(const MVEpoch &other) const
- Bool operator!=(const MVEpoch &other) const
- Bool near(const MVEpoch &other, Double tol = 1e-13) const
- Bool nearAbs(const MVEpoch &other, Double tol = 1e-13) const
- virtual uInt type() const
- static void assure(const MeasValue &in)
- virtual void adjust()
- virtual void adjust(Double &res)
- Double get() const
- Quantity getTime() const
- Quantity getTime(const Unit &unit) const
- Double getDay() const
- Double getDayFraction() const
- virtual void print(ostream &os) const
- virtual MeasValue *clone() const
- virtual Vector<Double> getVector() const
- virtual void putVector(const Vector<Double> &in)
- virtual Vector<Quantum<Double> > getRecordValue() const
- virtual Bool putValue(const Vector<Quantum<Double> > &in)
- Private Members
- Double makeDay(const Quantity &in) const
- void addTime(Double in)
Review Status
- Reviewed By:
- tcornwel
- Date Reviewed:
- 1996/02/22
- Programs:
- Tests:
Prerequisite
Etymology
MVEpoch from Measure, Value and Epoch
Synopsis
MVEpoch is a class for high precision (10-16 s) epochs over a
period of 6*1010 a.
MVEpochs can be compared, a time interval can be added or subtracted, and
the time difference can be found.
The following constructors:
- MVEpoch() default; assuming 0
- MVEpoch(Double) with time given in days
- MVEpoch(Double, Double=0) with times given in days
- MVEpoch(Quantity, Quantity=0) with times given
- MVEpoch(Quantum<Vector<Double> >) with times given
- MVEpoch(Vector<Double>) with times in days
- MVEpoch(Vector<Quantity>) with times
Example
See MEpoch
Motivation
To have high precision timing
To Do
- A proper high precision time, including multiplication etc should
be considered. E.g. a multi-byte number with 6 bytes day
and 8 bytes fractional day.
Member Description
Default constructor, generates default 0 epoch
MVEpoch(const MVEpoch &other)
Copy constructor
MVEpoch(Double inday, Double infrac=0)
MVEpoch(const Vector<Double> &inday)
Constructor with time in days
MVEpoch(const Quantity &in)
MVEpoch(const Quantity &in1, const Quantity &in2)
MVEpoch(const Quantum<Vector<Double> > &in)
MVEpoch(const Vector<Quantity> &in)
Constructor with Quantities
MVEpoch &operator=(const MVEpoch &other)
Copy assignment
MVEpoch &operator+=(const MVEpoch &other)
MVEpoch operator+(const MVEpoch &other) const
Add times
MVEpoch &operator-=(const MVEpoch &other)
MVEpoch operator-(const MVEpoch &other) const
Difference times
Bool operator==(const MVEpoch &other) const
Bool operator!=(const MVEpoch &other) const
Bool near(const MVEpoch &other, Double tol = 1e-13) const
Bool nearAbs(const MVEpoch &other, Double tol = 1e-13) const
Comparisons
virtual uInt type() const
static void assure(const MeasValue &in)
Tell me your type
virtual void adjust()
virtual void adjust(Double &res)
Adjust the time to its constituent parts. The returned result is always 1.0
Double get() const
Get value in days
Quantity getTime() const
Quantity getTime(const Unit &unit) const
Get value with units
Double getDay() const
Get value of integer days
Get fraction of days
virtual void print(ostream &os) const
Print a value
Clone a value
Get the value in internal units
virtual void putVector(const Vector<Double> &in)
Set the value from internal units (set 0 for empty vector)
Get the internal value as a Vector<Quantity>. Usable in
records. The getXRecordValue() gets additional information for records.
Note that the Vectors could be empty.
Set the internal value if correct values and dimensions
Double makeDay(const Quantity &in) const
Make days from quantity
void addTime(Double in)
Add time from days