13 #include "eckit/exception/Exceptions.h"
14 #include "oops/util/DateTime.h"
15 #include "oops/util/Logger.h"
22 const char *ObsFunctionTraits<util::DateTime>::valueTypeName =
"util::DateTime";
27 const char *ObsFunctionTraits<util::DateTime>::groupName =
"DateTimeObsFunction";
31 template <
typename FunctionValue>
33 if (getMakers().find(name) != getMakers().end()) {
34 throw eckit::UserError(name +
" already registered in ufo::ObsFunctionFactory<" +
38 getMakers()[name] =
this;
43 template <
typename FunctionValue>
45 oops::Log::trace() <<
"ObsFunctionBase::create starting" << std::endl;
46 typename std::map<std::string, ObsFunctionFactory*>::iterator jloc =
48 if (jloc == getMakers().end()) {
49 throw eckit::UserError(var.
variable() +
" does not exist in ufo::ObsFunctionFactory<" +
54 oops::Log::trace() <<
"ObsFunctionFactory::create done" << std::endl;
60 template <
typename FunctionValue>
62 return (getMakers().find(name) != getMakers().end());
Factory of ObsFunctions producing values of type FunctionValue.
static bool functionExists(const std::string &)
ObsFunctionFactory(const std::string &)
static ObsFunctionBase< FunctionValue > * create(const Variable &)
const std::string & variable() const
const eckit::LocalConfiguration & options() const
static const char * valueTypeName
Name of the type of values produced by subclasses of ObsFunctionBase<float>.
static const char * groupName
Name of the group identifying ObsFunctions producing floats.
static const char * valueTypeName
Name of the type of values produced by subclasses of ObsFunctionBase<int>.
static const char * groupName
Name of the group identifying ObsFunctions producing ints.
static const char * valueTypeName
Name of the type of values produced by subclasses of ObsFunctionBase<std::string>.
static const char * groupName
Name of the group identifying ObsFunctions producing strings.
Common properties of ObsFunctions producing values of type FunctionValue.