[498] | 1 | /*! |
---|
| 2 | \file netCdfInterface_impl.hpp |
---|
| 3 | \author Ha NGUYEN |
---|
| 4 | \date 06 Oct 2014 |
---|
| 5 | \since 06 Oct 2014 |
---|
| 6 | |
---|
| 7 | \brief Implemention of some templated functions in netCdfInterface |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #include "netCdfInterface_impl.hpp" |
---|
| 11 | |
---|
| 12 | namespace xios |
---|
| 13 | { |
---|
[686] | 14 | #define macroAtt(type) \ |
---|
| 15 | template int CNetCdfInterface::getAttType(int ncid, int varid, const StdString& attrName, type* data); \ |
---|
| 16 | template int CNetCdfInterface::putAttType(int ncid, int varid, const StdString& attrName, \ |
---|
| 17 | StdSize numVal, const type* data); |
---|
[498] | 18 | |
---|
[686] | 19 | macroAtt(double) |
---|
| 20 | macroAtt(float) |
---|
| 21 | macroAtt(int) |
---|
[2019] | 22 | macroAtt(size_t) |
---|
[686] | 23 | macroAtt(long) |
---|
| 24 | macroAtt(short) |
---|
| 25 | macroAtt(char) |
---|
[498] | 26 | |
---|
[686] | 27 | #define macroPutVar(type) \ |
---|
| 28 | template int CNetCdfInterface::getVaraType(int ncid, int varId, const StdSize* start, \ |
---|
| 29 | const StdSize* count, type* data); \ |
---|
[498] | 30 | template int CNetCdfInterface::putVaraType(int ncid, int varId, const StdSize* start, \ |
---|
[686] | 31 | const StdSize* count, const type* data); |
---|
| 32 | |
---|
| 33 | macroPutVar(double) |
---|
| 34 | macroPutVar(float) |
---|
| 35 | macroPutVar(int) |
---|
[2019] | 36 | macroPutVar(size_t) |
---|
[1158] | 37 | macroPutVar(char) |
---|
| 38 | |
---|
[686] | 39 | #define macroType(type, ncType) \ |
---|
| 40 | template<> nc_type CNetCdfInterface::getNcType<type>() { return ncType; } |
---|
| 41 | |
---|
| 42 | macroType(double, NC_DOUBLE) |
---|
| 43 | macroType(float, NC_FLOAT) |
---|
| 44 | macroType(int, NC_INT) |
---|
[2019] | 45 | macroType(size_t, NC_UINT64) |
---|
[686] | 46 | macroType(long, NC_LONG) |
---|
| 47 | macroType(short, NC_SHORT) |
---|
| 48 | macroType(char, NC_CHAR) |
---|
[498] | 49 | } |
---|