| 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 "Spacing.h" |
| 12 |
|
| 13 |
#include "eckit/config/Parametrisation.h" |
| 14 |
|
| 15 |
#include "atlas/grid/detail/spacing/SpacingFactory.h" |
| 16 |
#include "atlas/runtime/Exception.h" |
| 17 |
|
| 18 |
namespace atlas { |
| 19 |
namespace grid { |
| 20 |
namespace spacing { |
| 21 |
|
| 22 |
const Spacing* Spacing::create(const eckit::Parametrisation& params) { |
| 23 |
std::string spacingType; |
| 24 |
if (not params.get("type", spacingType)) { |
| 25 |
throw_Exception("type missing in configuration", Here()); |
| 26 |
} |
| 27 |
return SpacingFactory::build(spacingType, params); |
| 28 |
} |
| 29 |
|
| 30 |
} // namespace spacing |
| 31 |
} // namespace grid |
| 32 |
} // namespace atlas |