Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DataConfig.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/pipeline/DataConfig.h"
25 #include "cheetah/pipeline/DataExport.h"
26 #include "panda/ChannelId.h"
27 #include <iostream>
28 
29 namespace ska {
30 namespace cheetah {
31 namespace pipeline {
32 
33 
34 template<typename NumericalRep>
35 DataConfig<NumericalRep>::DataConfig()
36  : BaseT("sinks")
37 {
38 }
39 
40 template<typename NumericalRep>
41 DataConfig<NumericalRep>::~DataConfig()
42 {
43 }
44 
45 template<typename NumericalRep>
46 void DataConfig<NumericalRep>::add_options(OptionsDescriptionEasyInit& add_options)
47 {
48  add_options
49  ("list-output-streams", boost::program_options::bool_switch()->default_value(false)->notifier(std::bind(&DataConfig<NumericalRep>::list_export_types, this, std::placeholders::_1)), "print to stdout a list of output streamers available");
50  BaseT::add_options(add_options);
51 }
52 
53 template<typename NumericalRep>
55 {
56  if(b) {
57  // temporarily create a data export instance so we can query the available types
58  pipeline::DataExport<NumericalRep> exporter(*this);
59  for(auto const& type : exporter.available()) {
60  std::cout << type << "\n";
61  }
62  terminate();
63  }
64 }
65 
66 template<typename NumericalRep>
68 {
69  if(!_out) {
70  _out.reset(new DataExport<NumericalRep>(*this));
71  }
72  return *_out;
73 }
74 
75 } // namespace pipeline
76 } // namespace cheetah
77 } // namespace ska
std::set< ExporterType > const & available() const
return the exporter types available in this class
Definition: DataExport.cpp:127
Some limits and constants for FLDO.
Definition: Brdz.h:35
Data Input Configuration Parameters.
Definition: DataConfig.h:42