12 #include <initializer_list> 15 #include "eckit/config/LocalConfiguration.h" 27 class Config :
public eckit::LocalConfiguration {
34 Config(
const eckit::PathName& );
37 Config( std::istream&,
const std::string& format =
"json" );
40 Config(
const eckit::Configuration& );
43 template <
typename ValueT>
44 Config(
const std::string& name,
const ValueT& value );
46 template <
typename ValueT>
47 Config(
const std::string& name, std::initializer_list<ValueT>&& value );
52 template <
typename ValueT>
53 Config operator()(
const std::string& name,
const ValueT& value );
55 template <
typename ValueT>
56 Config operator()(
const std::string& name, std::initializer_list<ValueT>&& value );
62 using eckit::LocalConfiguration::set;
64 Config&
set(
const std::string& name,
const std::vector<Config>& );
66 Config&
set(
const eckit::LocalConfiguration& );
69 Config&
set(
const std::string& name, std::initializer_list<T>&& value );
71 Config&
remove(
const std::string& name );
75 using eckit::LocalConfiguration::get;
76 bool get(
const std::string& name, std::vector<Config>& value )
const;
78 std::vector<std::string> keys()
const;
83 template <
typename ValueT>
84 inline Config::Config(
const std::string& name,
const ValueT& value ) :
eckit::LocalConfiguration() {
88 template <
typename ValueT>
89 inline Config::Config(
const std::string& name, std::initializer_list<ValueT>&& value ) : eckit::LocalConfiguration() {
93 template <
typename ValueT>
99 template <
typename ValueT>
100 inline Config& Config::set(
const std::string& name, std::initializer_list<ValueT>&& value ) {
101 set( name, std::vector<ValueT>( value.begin(), value.end() ) );
105 template <
typename ValueT>
107 set( name, std::vector<ValueT>( value.begin(), value.end() ) );
115 Config* atlas__Config__new();
116 Config* atlas__Config__new_from_json(
const char* json );
117 Config* atlas__Config__new_from_file(
const char* path );
118 void atlas__Config__delete(
Config* This );
119 int atlas__Config__has(
Config* This,
const char* name );
120 void atlas__Config__set_config(
Config* This,
const char* name,
const Config* value );
121 void atlas__Config__set_config_list(
Config* This,
const char* name,
const Config* value[],
int size );
122 void atlas__Config__set_int(
Config* This,
const char* name,
int value );
123 void atlas__Config__set_long(
Config* This,
const char* name,
long value );
124 void atlas__Config__set_float(
Config* This,
const char* name,
float value );
125 void atlas__Config__set_double(
Config* This,
const char* name,
double value );
126 void atlas__Config__set_string(
Config* This,
const char* name,
const char* value );
127 void atlas__Config__set_array_int(
Config* This,
const char* name,
int value[],
int size );
128 void atlas__Config__set_array_long(
Config* This,
const char* name,
long value[],
int size );
129 void atlas__Config__set_array_float(
Config* This,
const char* name,
float value[],
int size );
130 void atlas__Config__set_array_double(
Config* This,
const char* name,
double value[],
int size );
132 int atlas__Config__get_config(
Config* This,
const char* name,
Config* value );
133 int atlas__Config__get_config_list(
Config* This,
const char* name,
Config** &value,
int& size,
int& allocated );
134 int atlas__Config__get_int(
Config* This,
const char* name,
int& value );
135 int atlas__Config__get_long(
Config* This,
const char* name,
long& value );
136 int atlas__Config__get_float(
Config* This,
const char* name,
float& value );
137 int atlas__Config__get_double(
Config* This,
const char* name,
double& value );
138 int atlas__Config__get_string(
Config* This,
const char* name,
char*& value,
int& size,
int& allocated );
139 int atlas__Config__get_array_int(
Config* This,
const char* name,
int*& value,
int& size,
int& allocated );
140 int atlas__Config__get_array_long(
Config* This,
const char* name,
long*& value,
int& size,
int& allocated );
141 int atlas__Config__get_array_float(
Config* This,
const char* name,
float*& value,
int& size,
int& allocated );
142 int atlas__Config__get_array_double(
Config* This,
const char* name,
double*& value,
int& size,
int& allocated );
143 void atlas__Config__json(
Config* This,
char*& json,
int& size,
int& allocated );
153 virtual bool has(
const std::string& name )
const {
return false; }
155 virtual bool get(
const std::string& name, std::string& value )
const {
return false; }
156 virtual bool get(
const std::string& name,
bool& value )
const {
return false; }
157 virtual bool get(
const std::string& name,
int& value )
const {
return false; }
158 virtual bool get(
const std::string& name,
long& value )
const {
return false; }
159 virtual bool get(
const std::string& name,
long long& value )
const {
return false; }
160 virtual bool get(
const std::string& name, std::size_t& value )
const {
return false; }
161 virtual bool get(
const std::string& name,
float& value )
const {
return false; }
162 virtual bool get(
const std::string& name,
double& value )
const {
return false; }
164 virtual bool get(
const std::string& name, std::vector<std::string>& value )
const {
return false; }
165 virtual bool get(
const std::string& name, std::vector<int>& value )
const {
return false; }
166 virtual bool get(
const std::string& name, std::vector<long>& value )
const {
return false; }
167 virtual bool get(
const std::string& name, std::vector<long long>& value )
const {
return false; }
168 virtual bool get(
const std::string& name, std::vector<std::size_t>& value )
const {
return false; }
169 virtual bool get(
const std::string& name, std::vector<float>& value )
const {
return false; }
170 virtual bool get(
const std::string& name, std::vector<double>& value )
const {
return false; }
virtual ~NoConfig()
Destructor redundant but fixes sanity compiler warnings.
Definition: Config.h:151
Config operator()(const std::string &name, const ValueT &value)
Operator that sets a key-value pair.
Definition: Config.h:94
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33
Configuration class used to construct various atlas components.
Definition: Config.h:27