8 #include "ioda/io/ObsIo.h" 
    9 #include "ioda/io/ObsIoFactory.h" 
   10 #include "ioda/ObsSpaceParameters.h" 
   12 #include "oops/util/AssociativeContainers.h" 
   13 #include "oops/util/Logger.h" 
   19     throw std::runtime_error(
name + 
" already registered in the ObsIo factory.");
 
   26   oops::Log::trace() << 
"ObsIoFactory::create starting" << std::endl;
 
   38       throw eckit::BadValue(
"Cannot create output file: the 'obsdataout' option has not been set",
 
   44     throw eckit::BadValue(
"Unknown mode", Here());
 
   49   oops::Log::trace() << 
"ObsIoFactory::create done" << std::endl;
 
   58   typename std::map<std::string, ObsIoFactory*>::iterator jloc = 
getMakers().find(
name);
 
   61     std::string makerNameList;
 
   62     for (
const auto& makerDetails : 
getMakers()) makerNameList += 
"\n  " + makerDetails.first;
 
   63     throw eckit::BadParameter(
name + 
" does not exist in ioda::ObsIoFactory. " 
   64                                 "Possible values:" + makerNameList, Here());
 
   75   static std::map <std::string, ObsIoFactory*> makers_;
 
ObsIoFactory(const std::string &)
Register a maker able to create instances of the specified ObsIo subclass.
static std::map< std::string, ObsIoFactory * > & getMakers()
virtual std::unique_ptr< ObsIoParametersBase > makeParameters() const =0
static ObsIoFactory & getMaker(const std::string &name)
static std::unique_ptr< ObsIoParametersBase > createParameters(const std::string &name)
Create and return an instance of the subclass of ObsIoParametersBase storing parameters of the specif...
virtual std::shared_ptr< ObsIo > make(const ObsIoParametersBase &ioParameters, const ObsSpaceParameters &obsSpaceParameters)=0
static std::shared_ptr< ObsIo > create(ObsIoModes mode, const ObsSpaceParameters ¶meters)
Create and return a new instance of an ObsIo subclass.
static std::vector< std::string > getMakerNames()
Return the names of all ObsIo subclasses that can be created by one of the registered makers.
Base of classes storing the configuration parameters of ObsIo subclasses.
oops::OptionalParameter< std::string > type
Identifies the ObsIo subclass to use.
ObsTopLevelParameters top_level_
sub groups of parameters
oops::OptionalParameter< ObsFileOutParameters > obsOutFile
output specification by writing to a file
const ObsIoParametersBase & obsIoInParameters() const
parameters indicating where to load data from