| 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 |
// file deepcode ignore CppMemoryLeak: static pointers for global registry are OK and will be cleaned up at end |
| 12 |
|
| 13 |
#include "atlas/field/MultiField.h" |
| 14 |
#include "atlas/field/MultiFieldCreator.h" |
| 15 |
|
| 16 |
#include <map> |
| 17 |
#include <sstream> |
| 18 |
#include <string> |
| 19 |
|
| 20 |
#include "atlas/field/detail/MultiFieldImpl.h" |
| 21 |
|
| 22 |
namespace atlas { |
| 23 |
namespace field { |
| 24 |
|
| 25 |
void MultiFieldImpl::add(Field& field) { |
| 26 |
ATLAS_ASSERT(not fieldset_.has(field.name()), "Field with name \"" + field.name() + "\" already exists!"); |
| 27 |
fieldset_.add(field); |
| 28 |
MultiFieldArrayRegistry::instance().add(field, array_); |
| 29 |
} |
| 30 |
|
| 31 |
} |
| 32 |
} |