UFO
ObsOperatorParametersBase.h
Go to the documentation of this file.
1 /*
2  * (C) Crown Copyright 2021, Met Office
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  */
7 
8 #ifndef UFO_OBSOPERATORPARAMETERSBASE_H_
9 #define UFO_OBSOPERATORPARAMETERSBASE_H_
10 
11 #include <string>
12 
13 #include "oops/util/parameters/ConfigurationParameter.h"
14 #include "oops/util/parameters/OptionalParameter.h"
15 #include "oops/util/parameters/Parameters.h"
16 
17 namespace ioda {
18  class ObsVector;
19 }
20 
21 namespace ufo {
22 
23 // -----------------------------------------------------------------------------
24 /// \brief Base class of classes storing configuration parameters of specific observation operators
25 /// and linear observation operators.
26 class ObsOperatorParametersBase : public oops::Parameters {
27  OOPS_ABSTRACT_PARAMETERS(ObsOperatorParametersBase, Parameters)
28 
29  public:
30  /// \brief Observation operator type.
31  ///
32  /// \note This parameter is marked as optional because it is only required in certain
33  /// circumstances (e.g. when observation operator parameters are deserialized into an
34  /// ObsOperatorParametersWrapper and used by OperatorFactory to instantiate a operator whose
35  /// type is determined at runtime), but not others (e.g. in tests written with a particular
36  /// operator in mind). ObsOperatorParametersWrapper will throw an exception if this parameter
37  /// is not provided.
38  oops::OptionalParameter<std::string> name{"name", this};
39 };
40 
41 // -----------------------------------------------------------------------------
42 
43 /// \brief A subclass of ObsOperatorParametersBase storing the values of all options in a
44 /// single Configuration object.
45 ///
46 /// This object can be accessed by calling the value() method of the \p config member variable.
47 ///
48 /// The ConfigurationParameter class does not perform any parameter validation; operators using
49 /// GenericObsOperatorParameters should therefore ideally be refactored, replacing this
50 /// class with a dedicated subclass of ObsOperatorParametersBase storing each parameter in
51 /// a separate (Optional/Required)Parameter object.
54  public:
55  oops::ConfigurationParameter config{this};
56 };
57 
58 // -----------------------------------------------------------------------------
59 
60 } // namespace ufo
61 
62 #endif // UFO_OBSOPERATORPARAMETERSBASE_H_
A subclass of ObsOperatorParametersBase storing the values of all options in a single Configuration o...
Base class of classes storing configuration parameters of specific observation operators and linear o...
oops::OptionalParameter< std::string > name
Observation operator type.
Forward declarations.
Definition: ObsAodExt.h:25
Definition: RunCRTM.h:27