Changeset 1468
- Timestamp:
- 08/05/10 17:45:28 (21 months ago)
- Location:
- trunk/bindings/cpp
- Files:
-
- 2 edited
-
NeXusFile.cpp (modified) (3 diffs)
-
NeXusFile.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bindings/cpp/NeXusFile.cpp
r1444 r1468 118 118 static int check_char_too_big[1 - sizeof(char) + ARRAY_OFFSET]; // error if char > 1 byte 119 119 120 static void inner_malloc(void* & data, std::vector<int>& dims, NXnumtype type) {120 static void inner_malloc(void* & data, const std::vector<int>& dims, NXnumtype type) { 121 121 int rank = dims.size(); 122 122 int c_dims[NX_MAXRANK]; … … 963 963 } 964 964 } 965 966 template<typename NumT> 967 void File::malloc(NumT*& data, const Info& info) 968 { 969 if (getType<NumT>() != info.type) 970 { 971 throw Exception("Type mismatch in malloc()"); 972 } 973 inner_malloc((void*&)data, info.dims, info.type); 974 } 975 976 template<typename NumT> 977 void File::free(NumT*& data) 978 { 979 inner_free((void*&)data); 980 } 981 965 982 } 966 983 … … 1193 1210 template 1194 1211 NXDLL_EXPORT void File::getAttr(const std::string& name, int& value); 1212 1213 template 1214 NXDLL_EXPORT void File::malloc(int*& data, const Info& info); 1215 template 1216 NXDLL_EXPORT void File::malloc(float*& data, const Info& info); 1217 template 1218 NXDLL_EXPORT void File::malloc(double*& data, const Info& info); 1219 1220 template 1221 NXDLL_EXPORT void File::free(int*& data); 1222 template 1223 NXDLL_EXPORT void File::free(float*& data); 1224 template 1225 NXDLL_EXPORT void File::free(double*& data); -
trunk/bindings/cpp/NeXusFile.hpp
r1466 r1468 162 162 void flush(); 163 163 164 template<typename NumT> 165 void malloc(NumT*& data, const Info& info); 166 167 template<typename NumT> 168 void free(NumT*& data); 169 164 170 /** 165 171 * Create a new group.
Note: See TracChangeset
for help on using the changeset viewer.
