Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Config.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_RCPT_LOW_CONFIG_H
25 #define SKA_CHEETAH_RCPT_LOW_CONFIG_H
26 
27 #include "cheetah/utils/Config.h"
28 #include "panda/EndpointConfig.h"
29 #include <panda/ProcessingEngine.h>
30 #include <panda/ProcessingEngineConfig.h>
31 #include <boost/asio/ip/udp.hpp>
32 
33 namespace ska {
34 namespace cheetah {
35 namespace rcpt_low {
36 
42 class Config : public utils::Config
43 {
44  public:
45  typedef panda::ProcessingEngine Engine;
46 
47  public:
48  Config();
49  ~Config();
50 
54  boost::asio::ip::udp::endpoint remote_end_point() const;
55  void remote_end_point(boost::asio::ip::udp::endpoint const& endpoint);
56 
57  Engine& engine() const;
58 
62  unsigned spectra_per_chunk() const;
63 
67  void spectra_per_chunk(unsigned samples);
68 
72  unsigned number_of_channels() const;
73 
78  void number_of_channels(unsigned samples);
79 
84  std::size_t max_buffers() const;
85 
86  protected:
87  void add_options(OptionsDescriptionEasyInit& add_options) override;
88 
89  private:
90  mutable std::unique_ptr<Engine> _engine;
91  panda::ProcessingEngineConfig _engine_config;
92  unsigned _spectra_per_chunk;
93  unsigned _number_of_channels;
94  std::size_t _max_buffer_count;
95  ska::panda::EndpointConfig _endpoint_config; // listen address
96 };
97 
98 
99 } // namespace rcpt_low
100 } // namespace cheetah
101 } // namespace ska
102 
103 #endif // SKA_CHEETAH_RCPT_LOW_CONFIG_H
configurable parameters for the rcpt
Definition: Config.h:42
Base class for module configuration.
Definition: Config.h:42
unsigned spectra_per_chunk() const
return the number of time samples in a chunk
Definition: Config.cpp:73
unsigned number_of_channels() const
return the number of channels in a chunk
Definition: Config.cpp:83
std::size_t max_buffers() const
return the maximum number of UDP packet buffers to use
Definition: Config.cpp:93
Some limits and constants for FLDO.
Definition: Brdz.h:35
boost::asio::ip::udp::endpoint remote_end_point() const
geters and setters for the UDP connection (IP address and port or remote peer)
Definition: Config.cpp:63