Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
SpCclSpeadProducer.cpp
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 #include "cheetah/producers/SpCclSpeadProducer.h"
25 
26 
27 namespace ska {
28 namespace cheetah {
29 namespace producers {
30 
31 template<typename DerivedType, typename TimeFrequencyT>
32 struct SpCclSpeadProducerCRTP<DerivedType, TimeFrequencyT>::NullCallback
33 {
34  inline
35  void operator()(std::shared_ptr<SpCclType> const&) const {}
36 };
37 
38 template<typename DerivedType, typename TimeFrequencyT>
39 std::shared_ptr<typename SpCclSpeadProducerCRTP<DerivedType, TimeFrequencyT>::SpCclType>
40 SpCclSpeadProducerCRTP<DerivedType, TimeFrequencyT>::DataFactory::operator()()
41 {
42  return _producer.template get_chunk<SpCclType>();
43 }
44 
45 template<typename DerivedType, typename TimeFrequencyT>
46 SpCclSpeadProducerCRTP<DerivedType, TimeFrequencyT>::SpCclSpeadProducerCRTP(exporters::SpCclSpeadReaderConfig const& config)
47  : _data_factory(*this)
48  , _reader(config, NullCallback(), _data_factory)
49 {
50 }
51 
52 template<typename DerivedType, typename TimeFrequencyT>
53 SpCclSpeadProducerCRTP<DerivedType, TimeFrequencyT>::~SpCclSpeadProducerCRTP()
54 {
55 }
56 
57 template<typename DerivedType, typename TimeFrequencyT>
58 void SpCclSpeadProducerCRTP<DerivedType, TimeFrequencyT>::init()
59 {
60  _reader.start();
61 }
62 
63 template<typename DerivedType, typename TimeFrequencyT>
64 bool SpCclSpeadProducerCRTP<DerivedType, TimeFrequencyT>::process()
65 {
66  _reader.process();
67  return false; // always producing data
68 }
69 
70 template<typename TimeFrequencyT>
71 SpCclSpeadProducer<TimeFrequencyT>::SpCclSpeadProducer(exporters::SpCclSpeadReaderConfig const& config)
72  : BaseT(config)
73 {
74 }
75 
76 } // namespace producers
77 } // namespace cheetah
78 } // namespace ska
Some limits and constants for FLDO.
Definition: Brdz.h:35