| 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 <sstream> |
| 12 |
|
| 13 |
#include "atlas/array/ArrayDataStore.h" |
| 14 |
#include "atlas/runtime/Exception.h" |
| 15 |
|
| 16 |
namespace atlas { |
| 17 |
namespace array { |
| 18 |
|
| 19 |
void throw_OutOfRange(const std::string& class_name, char idx_str, int idx, int max) { |
| 20 |
std::ostringstream msg; |
| 21 |
msg << class_name << " index " << idx << " out of bounds: " << idx << " >= " << max; |
| 22 |
throw_Exception(msg.str(), Here()); |
| 23 |
} |
| 24 |
|
| 25 |
} // namespace array |
| 26 |
} // namespace atlas |