TargetDuration.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2021 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/TargetDuration.h
10 
11 #ifndef __Pulsar_TargetDuration_h
12 #define __Pulsar_TargetDuration_h
13 
14 #include "Pulsar/TimeIntegrate.h"
15 #include "debug.h"
16 
17 namespace Pulsar {
18 
19  class TimeIntegrate::TargetDuration :
20  public Integrate<Archive>::RangePolicy
21  {
22 
23  public:
24 
25  TargetDuration (double seconds = 0.0) { duration = seconds; }
26 
27  void set_duration (double seconds) { duration = seconds; }
28  double get_duration () const { return duration; }
29 
31  void initialize (Integrate<Archive>*, Archive*);
32 
34  unsigned get_nrange () { return ranges.size(); }
35 
36  void get_range (unsigned irange, unsigned& start, unsigned& stop)
37  {
38  start = ranges[irange].first;
39  stop = ranges[irange].second;
40  }
41 
42  protected:
43 
45  std::vector< std::pair<unsigned,unsigned> > ranges;
46 
48  double duration;
49 
50  };
51 
52 }
53 
54 #endif
virtual void initialize(Integrate *, Container *)=0
Initialize ranges for the specified parameters.
Defines the PSRCHIVE library.
Definition: CalSource.h:17

Generated using doxygen 1.8.17