1 #ifndef teca_metadata_util_h
2 #define teca_metadata_util_h
6 #include "teca_config.h"
8 #include "teca_metadata.h"
24 const unsigned long mesh_extent[8],
unsigned long array_extent[8]);
33 template <
typename index_t>
35 std::string &request_key, index_t indices[2])
38 if (request.get(
"index_request_key", request_key))
40 TECA_ERROR(
"Failed to locate the index_request_key")
44 if (request.get(request_key, indices))
46 TECA_ERROR(
"Failed to get the requested indices using the"
47 " index_request_key \"" << request_key <<
"\"")
63 template <
typename index_t>
65 std::string &request_key, index_t &index)
68 if (request.get(
"index_request_key", request_key))
70 TECA_ERROR(
"Failed to locate the index_request_key")
75 if (request.get(request_key, indices))
77 TECA_ERROR(
"Failed to get the requested index using the"
78 " index_request_key \"" << request_key <<
"\"")
82 index_t n_indices = indices[1] - indices[0] + 1;
85 TECA_ERROR(<< n_indices <<
" requested when one was required")
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.
#define TECA_ERROR(_msg)
Constructs an error message and sends it to the stderr stream.
Definition: teca_common.h:161