Debian Codegraph @

src/atlas/grid/detail/spacing/SpacingFactory.cc

raw
1 /*
2 * (C) Copyright 2013 ECMWF.
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 * In applying this licence, ECMWF does not waive the privileges and immunities
7 * granted to it by virtue of its status as an intergovernmental organisation
8 * nor does it submit to any jurisdiction.
9 */
10
11 #include <string>
12
13 #include "atlas/grid/detail/spacing/SpacingFactory.h"
14
15 namespace atlas {
16 namespace grid {
17 namespace spacing {
18
19 //----------------------------------------------------------------------------------------------------------------------
20
21
22 void force_link() {
23 static struct Link { Link() = default; } link;
24 [](const Link&) {}(link); // disable unused warnings
25 }
26
27 //----------------------------------------------------------------------------------------------------------------------
28
29 const Spacing* SpacingFactory::build(const std::string& builder) {
30 return build(builder, util::NoConfig());
31 }
32
33 const Spacing* SpacingFactory::build(const std::string& builder, const eckit::Parametrisation& param) {
34 force_link();
35 auto factory = get(builder);
36 return factory->make(param);
37 }
38
39 //----------------------------------------------------------------------------------------------------------------------
40
41 } // namespace spacing
42 } // namespace grid
43 } // namespace atlas