netcdf-cxx4
netcdf-cxx4 copied to clipboard
Typesafe attribute accessors
class NcAtt needs modern typesafe ways to retrieve attribute values. This is especially true for retrieving multiple (vector) valued strings.
The following methods should be included:
getValue(TypeT &) // Retrieves the first value
getValues(std::vector<TypeT> &) // Retrieves all values
"getValues"(string) makes no sense: it retrieves a single value, not all values.
Why std::vector should be preffered over anything else? It may be worth to also consider adding iterator-based overload, like:
template <typename OutputIterator>
void getValues(OutputIterator first, size_t count);