| 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 |
#pragma once |
| 12 |
|
| 13 |
#include "atlas/util/DataType.h" |
| 14 |
|
| 15 |
#include "atlas/util/Config.h" |
| 16 |
|
| 17 |
// ---------------------------------------------------------------------------- |
| 18 |
|
| 19 |
namespace atlas { |
| 20 |
namespace option { |
| 21 |
|
| 22 |
// ---------------------------------------------------------------------------- |
| 23 |
|
| 24 |
class type : public util::Config { |
| 25 |
public: |
| 26 |
type(const std::string&); |
| 27 |
}; |
| 28 |
|
| 29 |
// ---------------------------------------------------------------------------- |
| 30 |
|
| 31 |
class global : public util::Config { |
| 32 |
public: |
| 33 |
global(size_t owner = 0); |
| 34 |
}; |
| 35 |
|
| 36 |
// ---------------------------------------------------------------------------- |
| 37 |
|
| 38 |
class levels : public util::Config { |
| 39 |
public: |
| 40 |
levels(size_t); |
| 41 |
}; |
| 42 |
|
| 43 |
// ---------------------------------------------------------------------------- |
| 44 |
|
| 45 |
class variables : public util::Config { |
| 46 |
public: |
| 47 |
variables(size_t); |
| 48 |
}; |
| 49 |
|
| 50 |
// ---------------------------------------------------------------------------- |
| 51 |
|
| 52 |
class vector : public util::Config { |
| 53 |
public: |
| 54 |
vector(size_t = 2); |
| 55 |
}; |
| 56 |
|
| 57 |
// ---------------------------------------------------------------------------- |
| 58 |
|
| 59 |
class vector_component : public util::Config { |
| 60 |
public: |
| 61 |
vector_component(const std::string& vector_field_name, size_t index); |
| 62 |
}; |
| 63 |
|
| 64 |
// ---------------------------------------------------------------------------- |
| 65 |
|
| 66 |
class name : public util::Config { |
| 67 |
public: |
| 68 |
name(const std::string&); |
| 69 |
}; |
| 70 |
|
| 71 |
// ---------------------------------------------------------------------------- |
| 72 |
|
| 73 |
template <typename T> |
| 74 |
class datatypeT : public util::Config { |
| 75 |
public: |
| 76 |
datatypeT(); |
| 77 |
}; |
| 78 |
|
| 79 |
// ---------------------------------------------------------------------------- |
| 80 |
|
| 81 |
class datatype : public util::Config { |
| 82 |
public: |
| 83 |
datatype(DataType::kind_t); |
| 84 |
datatype(const std::string&); |
| 85 |
datatype(DataType); |
| 86 |
}; |
| 87 |
|
| 88 |
// ---------------------------------------------------------------------------- |
| 89 |
|
| 90 |
class shape : public util::Config { |
| 91 |
public: |
| 92 |
template <typename T> |
| 93 |
shape(const std::initializer_list<T>& list) { |
| 94 |
set("shape", list); |
| 95 |
} |
| 96 |
}; |
| 97 |
|
| 98 |
class alignment : public util::Config { |
| 99 |
public: |
| 100 |
alignment(int); |
| 101 |
}; |
| 102 |
|
| 103 |
// ---------------------------------------------------------------------------- |
| 104 |
|
| 105 |
class halo : public util::Config { |
| 106 |
public: |
| 107 |
halo(size_t size); |
| 108 |
}; |
| 109 |
|
| 110 |
// ---------------------------------------------------------------------------- |
| 111 |
|
| 112 |
class radius : public util::Config { |
| 113 |
public: |
| 114 |
radius(double); |
| 115 |
radius(const std::string& = "Earth"); |
| 116 |
}; |
| 117 |
|
| 118 |
// --------------------------------- |
| 119 |
|
| 120 |
class pole_edges : public util::Config { |
| 121 |
public: |
| 122 |
pole_edges(bool = true); |
| 123 |
}; |
| 124 |
|
| 125 |
class on_device : public util::Config { |
| 126 |
public: |
| 127 |
on_device(); |
| 128 |
}; |
| 129 |
|
| 130 |
// ---------------------------------------------------------------------------- |
| 131 |
// Definitions |
| 132 |
// ---------------------------------------------------------------------------- |
| 133 |
|
| 134 |
template <typename T> |
| 135 |
datatypeT<T>::datatypeT() { |
| 136 |
set("datatype", DataType::kind<T>()); |
| 137 |
} |
| 138 |
|
| 139 |
} // namespace option |
| 140 |
} // namespace atlas |