Belle II Software  release-08-01-10
FilterFactory.dcl.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <tracking/trackFindingCDC/filters/base/FilterFactory.fwd.h>
11 
12 #include <map>
13 #include <string>
14 #include <memory>
15 
16 namespace Belle2 {
21  namespace TrackFindingCDC {
22 
24  template<class AFilter>
25  class FilterFactory {
26 
27  public:
29  using CreatedFilter = AFilter;
30 
31  public:
33  FilterFactory(const std::string& defaultFilterName = "");
34 
36  virtual ~FilterFactory();
37 
38  public:
40  virtual std::string getIdentifier() const = 0;
41 
43  virtual std::string getFilterPurpose() const = 0;
44 
46  virtual std::map<std::string, std::string> getValidFilterNamesAndDescriptions() const = 0;
47 
53  virtual std::unique_ptr<AFilter> create(const std::string& filterName) const;
54 
56  virtual std::string createFiltersNameDescription() const;
57 
59  virtual std::string createFiltersParametersDescription() const;
60 
61  public:
63  const std::string& getDefaultFilterName() const;
64 
65  private:
67  std::string m_defaultFilterName;
68  };
69  }
71 }
Factory that can create apropriate filter instances from a name.
virtual std::string createFiltersParametersDescription() const
Create a string with a description mentioning the parameters of the chooseable filter.
virtual std::string getIdentifier() const =0
Getter for a short identifier of the factory. Currently unused.
std::string m_defaultFilterName
Legacy - Default filter name suggested by this factory.
virtual std::unique_ptr< AFilter > create(const std::string &filterName) const
Create a filter with the given name, does not set filter specific parameters.
virtual ~FilterFactory()
Make destructor of interface class virtual.
FilterFactory(const std::string &defaultFilterName="")
Fill the default filter name values.
const std::string & getDefaultFilterName() const
Legacy - Return the default filter suggested by the factory.
virtual std::map< std::string, std::string > getValidFilterNamesAndDescriptions() const =0
Getter for the valid filter names and a description for each.
virtual std::string createFiltersNameDescription() const
Create a string with a description mentioning the names of the chooseable filter.
AFilter CreatedFilter
Type of the filter that this factory creates.
virtual std::string getFilterPurpose() const =0
Getter for a descriptive purpose of the filter.
Abstract base class for different kinds of events.