Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DataExportConfig.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_EXPORTERS_DATAEXPORTCONFIG_H
25 #define SKA_CHEETAH_EXPORTERS_DATAEXPORTCONFIG_H
26 
27 
28 #include "cheetah/utils/Config.h"
29 #include "cheetah/exporters/DataExportStreamConfig.h"
30 #include "panda/ChannelsConfig.h"
31 #include "panda/DataSwitchConfig.h"
32 #include <vector>
33 #include <string>
34 
35 namespace ska {
36 namespace cheetah {
37 namespace exporters {
38 
67 {
68  public:
69  DataExportConfig(std::string const& tag = std::string("sinks") );
71 
75  panda::DataSwitchConfig& switch_config() const;
76 
80  void activate_streams(std::vector<std::string> const& streams);
81  void activate(panda::ChannelId const& channel);
82 
87  void number_of_threads(unsigned const& number_of_threads);
88 
93 
97  std::vector<DataExportStreamConfig> const& exporters() const;
98 
102  void channel(panda::ChannelInfo const&);
103 
107  panda::ProcessingEngineConfig const& engine_config(panda::ChannelId const& channel_id) const;
108 
112  void set_engine_config(panda::ChannelId const& channel_id, panda::ProcessingEngineConfig const& config);
113 
118  void set_engine_config(panda::ProcessingEngineConfig const& config);
119 
120  void parse_property_tree(boost::property_tree::ptree const& pt, boost::program_options::variables_map& vm) override;
121 
122  void add_sink(std::string const& tag, std::function<panda::ConfigModule*()> const& cm);
123  void add_sink(panda::ConfigModule& cm);
124 
128  panda::Engine& engine(panda::ChannelId const&);
129 
130  protected:
131  void add_options(OptionsDescriptionEasyInit& add_options) override;
132 
133  private:
134  class SinkConfigs: public panda::ConfigModule
135  {
136  public:
137  SinkConfigs();
138  void add_options(OptionsDescriptionEasyInit& add_options) override;
139  };
140 
141  private:
142  mutable panda::DataSwitchConfig _switch_config;
143  panda::ChannelsConfig _channel_config;
144  SinkConfigs _sink_configs;
145  mutable std::vector<DataExportStreamConfig> _sinks;
146  mutable bool _exporters_init;
147 };
148 
149 } // namespace exporters
150 } // namespace cheetah
151 } // namespace ska
152 
153 
154 #endif // SKA_CHEETAH_EXPORTERS_DATAEXPORTCONFIG_H
Configuration Object for DataExport module.
void channel(panda::ChannelInfo const &)
explicity add a channel configuration
std::vector< DataExportStreamConfig > const & exporters() const
return a list of configured export streamer configurations
void activate_streams(std::vector< std::string > const &streams)
mark the provided streams as active
Base class for module configuration.
Definition: Config.h:42
panda::Engine & engine(panda::ChannelId const &)
return the engine allocated to the specified channel
Defines the mapping of a sinks configuration block with the sink type, and the channel to associate i...
void set_engine_config(panda::ChannelId const &channel_id, panda::ProcessingEngineConfig const &config)
set the engine confugration for a specified channel
void add_exporter(DataExportStreamConfig)
set an export streamer configurations
Some limits and constants for FLDO.
Definition: Brdz.h:35
panda::ProcessingEngineConfig const & engine_config(panda::ChannelId const &channel_id) const
return the processing engine configuration associated with the specified channel
panda::DataSwitchConfig & switch_config() const
return the configuration suitable for sending to a panda::DataSwitch
void number_of_threads(unsigned const &number_of_threads)
set the number of dedicated threads to service exporters export (default 0)