Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
SiftModule.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_SIFT_SIFTMODULE_H
25 #define SKA_CHEETAH_SIFT_SIFTMODULE_H
26 
27 #include "cheetah/sift/detail/SiftAlgoFactory.h"
28 #include "cheetah/utils/AlgoModule.h"
29 #include "cheetah/data/Ccl.h"
30 #include "cheetah/data/Scl.h"
31 #include "panda/ConfigurableTask.h"
32 #include "panda/PoolSelector.h"
33 #include <memory>
34 
35 namespace ska {
36 namespace cheetah {
37 namespace sift {
38 
39 template<typename ConfigT, typename HandlerT>
40 class SiftTraits {
41  public:
42  typedef ConfigT ConfigType;
43  typedef typename ConfigType::PoolType PoolType;
44  typedef HandlerT Handler;
45 };
46 
47 template<typename SiftTraits, typename SiftAlgo, typename... SiftAlgos>
49 {
50  public:
52  typedef std::tuple<SiftAlgo, SiftAlgos...> Algos;
53  typedef std::tuple<panda::SubmitMethod<std::shared_ptr<data::Ccl> const&>
54  > Signatures;
55 };
56 
61 template<class SiftTraits, typename... SiftAlgos>
62 class SiftModule : public utils::AlgoModule<SiftAlgoModuleTraits<SiftTraits, SiftAlgos...>>
63 {
65  typedef typename SiftTraits::ConfigType Config;
66  typedef typename SiftTraits::Handler Handler;
67 
68  public:
69  SiftModule(Config const&, Handler& handler);
70 
74  template <typename Arch>
75  std::shared_ptr<data::Scl> operator()(
76  panda::PoolResource<Arch>& resource,
77  data::Ccl& input);
78 
82  std::shared_ptr<panda::ResourceJob> operator()(std::shared_ptr<data::Ccl> const&) const;
83 
87  template<typename OtherDataType
88  , typename std::enable_if<std::is_convertible<OtherDataType, data::Ccl>::value, bool>::type = true
89  >
90  std::shared_ptr<panda::ResourceJob> operator()(std::shared_ptr<OtherDataType> const&);
91 
92 };
93 
94 
95 } // namespace sift
96 } // namespace cheetah
97 } // namespace ska
98 #include "cheetah/sift/detail/SiftModule.cpp"
99 
100 #endif // SKA_CHEETAH_SIFT_SIFTMODULE_H
Provides a module of multiple algorimic implementations to perform a specific task.
Definition: AlgoModule.h:53
Module for configuration and launnch of Sift algorithms.
Definition: SiftModule.h:62
Some limits and constants for FLDO.
Definition: Brdz.h:35
Factory for Sift algorithms.
Candidate list.
Definition: Ccl.h:45