Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DataExport.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_DATAEXPORTIMPL_H
25 #define SKA_CHEETAH_EXPORTERS_DATAEXPORTIMPL_H
26 
27 
28 #include "cheetah/exporters/DataExportConfig.h"
29 #include "cheetah/exporters/TestProbe.h"
30 #include "panda/DataSwitch.h"
31 #include "panda/TupleUtilities.h"
32 #include <tuple>
33 #include <map>
34 
35 namespace ska {
36 namespace cheetah {
37 namespace exporters {
38 class ExporterType;
39 template<typename DataExporterType, typename T> class ExportInitialiser;
40 
54 template<typename... DataTypes>
55 class DataExport : public panda::DataSwitch<DataTypes...>
56 {
57  typedef panda::DataSwitch<DataTypes...> BaseT;
58 
59  public:
61  virtual ~DataExport() = 0; // do not use this class directly
62 
66  std::set<ExporterType> const& available() const;
67 
71  template<typename DataType>
72  TestProbe<DataType>& activate_test_probe(panda::ChannelId const&);
73 
74  protected:
85  template<typename DataType, typename FactoryType>
86  void set_factory(ExporterType const& type_id, FactoryType factory);
87 
92  void init();
93 
94  protected:
95  std::tuple<ExportInitialiser<DataExport<DataTypes...>, DataTypes>...> _initialisers;
96  DataExportConfig const& _config;
97  std::set<ExporterType> _types;
98 };
99 
100 } // namespace exporters
101 } // namespace cheetah
102 } // namespace ska
103 #include "cheetah/exporters/detail/DataExport.cpp"
104 
105 #endif // SKA_CHEETAH_EXPORTERS_DATAEXPORTIMPL_H
Configuration Object for DataExport module.
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
void init()
initialise the output handlers using the factories supplied by set_factory(). Only call after all fac...
Definition: DataExport.cpp:119
string based tag for refering to the type of Exporter, based on a std::string
Definition: ExporterType.h:36
Attach to a stream to record the data sent.
Definition: TestProbe.h:42
This class initialises a suitable panda::DataSwitch according to the exporters::DataExportConfigurati...
Definition: DataExport.h:55
TestProbe< DataType > & activate_test_probe(panda::ChannelId const &)
activates a TestProbe object for monitoring the streamed data of DataType to a specific ...
Definition: DataExport.cpp:134