8 #ifndef DISTRIBUTION_DISTRIBUTIONFACTORY_H_
9 #define DISTRIBUTION_DISTRIBUTIONFACTORY_H_
15 #include "eckit/config/Configuration.h"
16 #include "eckit/geometry/Point2.h"
17 #include "ioda/distribution/Distribution.h"
37 static std::unique_ptr<Distribution>
create(
const eckit::mpi::Comm & comm,
38 const eckit::Configuration & config);
44 virtual std::unique_ptr<Distribution>
make(
const eckit::mpi::Comm & comm,
45 const eckit::Configuration &config) = 0;
47 static std::map < std::string, DistributionFactory * > &
getMakers() {
48 static std::map < std::string, DistributionFactory * > makers_;
59 std::unique_ptr<Distribution>
make(
const eckit::mpi::Comm & comm,
60 const eckit::Configuration &config)
override
61 {
return std::unique_ptr<Distribution>(
new T(comm, config)); }
static std::map< std::string, DistributionFactory * > & getMakers()
virtual ~DistributionFactory()=default
DistributionFactory(const std::string &name)
virtual std::unique_ptr< Distribution > make(const eckit::mpi::Comm &comm, const eckit::Configuration &config)=0
static std::unique_ptr< Distribution > create(const eckit::mpi::Comm &comm, const eckit::Configuration &config)
Create a Distribution object implementing a particular method of distributing observations across mul...
A class able to instantiate objects of type T, which should be a subclass of Distribution.
DistributionMaker(const std::string &name)
std::unique_ptr< Distribution > make(const eckit::mpi::Comm &comm, const eckit::Configuration &config) override