Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
TimeSeries.h
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2016 The SKA organisation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef SKA_CHEETAH_DATA_TIMESERIES_H
25 #define SKA_CHEETAH_DATA_TIMESERIES_H
26 
27 #include "cheetah/data/Series.h"
28 #include "cheetah/data/Units.h"
29 #include "cheetah/data/DefaultAllocator.h"
30 #include "cheetah/utils/Architectures.h"
31 
32 #include "panda/DataChunk.h"
33 
34 namespace ska {
35 namespace cheetah {
36 namespace data {
37 
38 
46 template <typename Arch, typename ValueType, typename Alloc=typename DefaultAllocator<Arch,ValueType>::type>
48  : public Series<Arch, ValueType, Alloc>
49  , public panda::DataChunk<TimeSeries<Arch, ValueType, Alloc>>
50 {
52 
53  public:
54  typedef Alloc Allocator;
55 
56  public:
63  explicit TimeSeries(Allocator const& alloc=Allocator());
64 
71  explicit TimeSeries(std::size_t size, Allocator const& alloc=Allocator());
72 
76  template<typename OtherArch, typename OtherAlloc>
77  explicit TimeSeries(TimeSeries<OtherArch, ValueType, OtherAlloc> const& copy, Alloc const& allocator = Allocator());
78 
86  TimeSeries(TimeType const& dt, std::size_t size=0, Allocator const& alloc=Allocator());
87  ~TimeSeries();
88 
94  TimeType const& sampling_interval() const;
95 
101  void sampling_interval(TimeType const& dt);
102 
103  private:
104  TimeType _sampling_interval;
105 };
106 
107 } // namespace data
108 } // namespace cheetah
109 } // namespace ska
110 
111 #include "cheetah/data/detail/TimeSeries.cpp"
112 
113 #endif // SKA_CHEETAH_DATA_TIMESERIES_H
TimeType const & sampling_interval() const
Retrive the sampling interval.
Definition: TimeSeries.cpp:64
TimeSeries(Allocator const &alloc=Allocator())
Construct a regularly sampled time series.
Definition: TimeSeries.cpp:38
Some limits and constants for FLDO.
Definition: Brdz.h:35
Base class for generic data series.
Definition: Series.h:44
Class for time series data.
Definition: TimeSeries.h:47
std::size_t size() const
the size of the series
Definition: Series.cpp:109