TimeInterval.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2023 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // dspsr/Kernel/Classes/TimeInterval.h
10 
11 #ifndef __dsp_Kernel_Classes_TimeInterval_h
12 #define __dsp_Kernel_Classes_TimeInterval_h
13 
14 #include "MJD.h"
15 
18 {
19  public:
20  MJD start_time;
21  MJD end_time;
22  double duration; // duration in seconds
23 
25  TimeInterval (const MJD& start, double seconds);
26 
28  bool overlaps (const TimeInterval&);
29 
31  bool before (const TimeInterval&);
32 
34  bool after (const TimeInterval&);
35 };
36 
37 #endif
bool overlaps(const TimeInterval &)
Return true if this TimeInterval overlaps (partially spans) the given TimeInterval.
Definition: TimeInterval.C:17
bool before(const TimeInterval &)
Return true if this TimeInterval ends before the given TimeInterval.
Definition: TimeInterval.C:22
A time TimeInterval.
Definition: TimeInterval.h:17
TimeInterval(const MJD &start, double seconds)
Construct from a start time and duration in seconds.
Definition: TimeInterval.C:10
bool after(const TimeInterval &)
Return true if this TimeInterval starts after the given TimeInterval.
Definition: TimeInterval.C:27

Generated using doxygen 1.8.17