本文整理汇总了C++中H5Tequal函数的典型用法代码示例。如果您正苦于以下问题:C++ H5Tequal函数的具体用法?C++ H5Tequal怎么用?C++ H5Tequal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了H5Tequal函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: EquivalentDatatypes
//-*****************************************************************************
bool EquivalentDatatypes( hid_t iA, hid_t iB )
{
if ( iA >= 0 && iB >= 0 )
{
if ( H5Tequal( iA, iB ) > 0 )
{
return true;
}
// If they're not equal, but they are both arrayed and
// both have the same super type
// and dimensions, they're equivalent
if ( H5Tget_class( iA ) == H5T_ARRAY &&
H5Tget_class( iB ) == H5T_ARRAY )
{
hid_t superA = H5Tget_super( iA );
hid_t superB = H5Tget_super( iB );
if ( superA >= 0 && superB >= 0 &&
H5Tequal( superA, superB ) > 0 )
{
Dimensions aDims;
getDatatypeArrayDims( iA, aDims );
Dimensions bDims;
getDatatypeArrayDims( iB, bDims );
if ( aDims == bDims )
{
return true;
}
}
}
}
return false;
}
开发者ID:ryutaro765,项目名称:Alembic,代码行数:34,代码来源:HDF5Util.cpp
示例2: memset
int H5mdfile::H5_Dread(int argc, char **argv, Tcl_Interp *interp)
{
/* Read h5-dataset and write to dataset array values */
// Allocate memeory
if(dset_data!=NULL) free(dset_data);
if(H5Tequal(dataset_type_id, H5T_NATIVE_FLOAT))
{
dset_data=(float*) Utils::malloc(dset_data_size*sizeof(float));
memset(dset_data,0,dset_data_size*sizeof(float));
}
else if(H5Tequal(dataset_type_id, H5T_NATIVE_DOUBLE))
{
dset_data=(double*) Utils::malloc(dset_data_size*sizeof(double));
memset(dset_data,0,dset_data_size*sizeof(double));
}
else if(H5Tequal(dataset_type_id, H5T_NATIVE_INT))
{
dset_data=(int*) Utils::malloc(dset_data_size*sizeof(int));
memset(dset_data,0,dset_data_size*sizeof(int));
}
else if(H5Tequal(dataset_type_id, H5T_C_S1))
{
dset_data = (h5string*) Utils::malloc(dset_data_size * sizeof(h5string));
}
else
{
Tcl_AppendResult(interp, "\nh5mdfile: No data type in H5_Dread given\n",(char *) NULL);
return TCL_ERROR;
}
// Read h5-dataset
status = H5Dread(dataset_id, dataset_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT,dset_data);
return TCL_OK;
}
开发者ID:Clemson-MSE,项目名称:espresso,代码行数:34,代码来源:h5mdfile_tcl.cpp
示例3: Tcl_PrintDouble
int H5mdfile::H5_read_value(int argc, char **argv,Tcl_Interp *interp)
{
/* Read value from dataset array and print it to Tcl */
// Get array index
int index=0;
if(dataset_rank>=1) index+=atoi(argv[2+dataset_rank-0]);
if(dataset_rank>=2) index+=atoi(argv[2+dataset_rank-1])*dims[dataset_rank-1];else goto label_index;
if(dataset_rank>=3) index+=atoi(argv[2+dataset_rank-2])*dims[dataset_rank-1]*dims[dataset_rank-2];else goto label_index;
if(dataset_rank>=4) index+=atoi(argv[2+dataset_rank-3])*dims[dataset_rank-1]*dims[dataset_rank-2]*dims[dataset_rank-3];else goto label_index;
if(dataset_rank>=5) index+=atoi(argv[2+dataset_rank-4])*dims[dataset_rank-1]*dims[dataset_rank-2]*dims[dataset_rank-3]*dims[dataset_rank-4];else goto label_index;
if(dataset_rank>=6) index+=atoi(argv[2+dataset_rank-5])*dims[dataset_rank-1]*dims[dataset_rank-2]*dims[dataset_rank-3]*dims[dataset_rank-4]*dims[dataset_rank-5];else goto label_index;
if(dataset_rank>=7) index+=atoi(argv[2+dataset_rank-6])*dims[dataset_rank-1]*dims[dataset_rank-2]*dims[dataset_rank-3]*dims[dataset_rank-4]*dims[dataset_rank-5]*dims[dataset_rank-6];else goto label_index;
if(dataset_rank>=8) index+=atoi(argv[2+dataset_rank-7])*dims[dataset_rank-1]*dims[dataset_rank-2]*dims[dataset_rank-3]*dims[dataset_rank-4]*dims[dataset_rank-5]*dims[dataset_rank-6]*dims[dataset_rank-7];else goto label_index;
label_index:
// Read single value from dataset array and print to Tcl
if(H5Tequal(dataset_type_id, H5T_NATIVE_FLOAT))
{
dset_data_float = static_cast<float*>(dset_data);
dset_data_singlevalue_float = dset_data_float[index];
char buffer[TCL_DOUBLE_SPACE + TCL_INTEGER_SPACE + 2];
Tcl_PrintDouble(interp, (double)dset_data_singlevalue_float, buffer);
Tcl_AppendResult(interp, buffer, (char *)NULL);
return TCL_OK;
}
if(H5Tequal(dataset_type_id, H5T_NATIVE_DOUBLE))
{
dset_data_double = static_cast<double*>(dset_data);
dset_data_singlevalue_double = dset_data_double[index];
char buffer[TCL_DOUBLE_SPACE + TCL_INTEGER_SPACE + 2];
Tcl_PrintDouble(interp, dset_data_singlevalue_double, buffer);
Tcl_AppendResult(interp, buffer, (char *)NULL);
return TCL_OK;
}
if(H5Tequal(dataset_type_id, H5T_NATIVE_INT))
{
dset_data_int = static_cast<int*>(dset_data);
dset_data_singlevalue_int = dset_data_int[index];
char buffer[TCL_DOUBLE_SPACE + TCL_INTEGER_SPACE + 2];
Tcl_PrintDouble(interp, (double)dset_data_singlevalue_int, buffer);
Tcl_AppendResult(interp, buffer, (char *)NULL);
return TCL_OK;
}
if(H5Tequal(dataset_type_id, H5T_C_S1))
{
dset_data_string = static_cast<h5string*>(dset_data);
dset_data_singlevalue_string = dset_data_string[index];
dataspace_simple_id = H5S_ALL;
dataspace_id = H5S_ALL;
Tcl_AppendResult(interp, dset_data_singlevalue_string, (char *)NULL);
return TCL_OK;
}
return TCL_ERROR;
}
开发者ID:Clemson-MSE,项目名称:espresso,代码行数:56,代码来源:h5mdfile_tcl.cpp
示例4: isCharType
bool isCharType(hid_t dataType) {
if (H5Tequal(dataType, H5T_NATIVE_CHAR)) {
return true;
}
hid_t nativeType = H5Tget_native_type(dataType, H5T_DIR_ASCEND);
bool answer = H5Tequal(nativeType, H5T_NATIVE_CHAR);
H5Tclose(nativeType);
return answer;
}
开发者ID:EricAlex,项目名称:ThirdParty-dev,代码行数:11,代码来源:VsUtils.C
示例5: if
std::string hdf5attribute::read_as_string()
{
std::string result;
if(H5Tequal(_type_id, H5T_NATIVE_INT16))
result = boost::lexical_cast<std::string>(read<short>());
else if(H5Tequal(_type_id, H5T_NATIVE_INT32))
result = boost::lexical_cast<std::string>(read<int>());
else if(H5Tequal(_type_id, H5T_NATIVE_UINT32))
result = boost::lexical_cast<std::string>(read<unsigned int>());
else if(H5Tequal(_type_id, H5T_NATIVE_UINT16))
result = boost::lexical_cast<std::string>(read<unsigned short>());
else if(H5Tequal(_type_id, H5T_NATIVE_UINT8))
result = boost::lexical_cast<std::string>(read<unsigned char>());
else if(H5Tequal(_type_id, H5T_NATIVE_INT8))
result = boost::lexical_cast<std::string>(read<char>());
else if(H5Tequal(_type_id, H5T_NATIVE_FLOAT))
result = boost::lexical_cast<std::string>(read<float>());
else if(H5Tequal(_type_id, H5T_NATIVE_DOUBLE))
result = boost::lexical_cast<std::string>(read<double>());
else if(H5Tget_class(_type_id) == H5T_STRING)
result = read<std::string>();
else
throw std::runtime_error("unknown type");
return result;
}
开发者ID:klindworth,项目名称:cvwidgets,代码行数:25,代码来源:hdf5internals.cpp
示例6: nc4_rec_find_hdf_type
/* Recursively hunt for a HDF type id. */
NC_TYPE_INFO_T *
nc4_rec_find_hdf_type(NC_GRP_INFO_T *start_grp, hid_t target_hdf_typeid)
{
NC_GRP_INFO_T *g;
NC_TYPE_INFO_T *type, *res;
htri_t equal;
assert(start_grp);
/* Does this group have the type we are searching for? */
for (type = start_grp->type; type; type = type->l.next)
{
if ((equal = H5Tequal(type->native_hdf_typeid ? type->native_hdf_typeid : type->hdf_typeid, target_hdf_typeid)) < 0)
return NULL;
if (equal)
return type;
}
/* Shake down the kids. */
if (start_grp->children)
for (g = start_grp->children; g; g = g->l.next)
if ((res = nc4_rec_find_hdf_type(g, target_hdf_typeid)))
return res;
/* Can't find it. Fate, why do you mock me? */
return NULL;
}
开发者ID:nschloe,项目名称:netcdf-c,代码行数:28,代码来源:nc4internal.c
示例7: EquivalentDatatypes
//-*****************************************************************************
bool EquivalentDatatypes( hid_t iA, hid_t iB )
{
if ( iA >= 0 && iB >= 0 && H5Tequal( iA, iB ) > 0 )
return true;
return false;
}
开发者ID:AWhetter,项目名称:alembic,代码行数:8,代码来源:HDF5Util.cpp
示例8: main
int main(){
hid_t fprop;
hid_t fid;
hid_t vol_id = H5VL_memvol_init();
char name[1024];
// create some datatypes
hid_t tid = H5Tcreate (H5T_COMPOUND, sizeof(complex_type));
H5Tinsert(tid, "re", HOFFSET(complex_type,re), H5T_NATIVE_DOUBLE);
H5Tinsert(tid, "im", HOFFSET(complex_type,im), H5T_NATIVE_DOUBLE);
hid_t s10 = H5Tcopy(H5T_C_S1);
H5Tset_size(s10, 10);
H5Tinsert(tid, "name", HOFFSET(complex_type,name), s10);
H5Tinsert(tid, "val", HOFFSET(complex_type,val), H5T_NATIVE_INT);
// packed version of the datatype
hid_t disk_tid = H5Tcopy (tid);
H5Tpack(disk_tid);
fprop = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_vol(fprop, vol_id, &fprop);
fid = H5Fcreate("test", H5F_ACC_TRUNC, H5P_DEFAULT, fprop);
H5VLget_plugin_name(fid, name, 1024);
printf ("%s using VOL %s\n", __FILE__ , name);
assert(H5Tcommit(fid, "t_complex", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) >= 0);
assert(H5Tcommit(fid, "t_complex_p", disk_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) >= 0);
hid_t tid_stored1 = H5Topen(fid, "t_complex", H5P_DEFAULT);
hid_t tid_stored2 = H5Topen(fid, "t_complex_p", H5P_DEFAULT);
// hid_t tid_stored3 = H5Topen(fid, "NotExisting", H5P_DEFAULT);
// assert(tid_stored3 < 0);
assert(H5Tequal(tid_stored1, tid));
assert(H5Tequal(tid_stored2, disk_tid));
H5Fclose(fid);
H5Tclose(tid);
H5Tclose(disk_tid);
H5VL_memvol_finalize();
return 0;
}
开发者ID:ESiWACE,项目名称:ESD-Middleware,代码行数:47,代码来源:direct-datatype.c
示例9: test_fps
/*-------------------------------------------------------------------------
* subroutine for test_text_dtype(): test_fps().
*-------------------------------------------------------------------------
*/
static int test_fps(void)
{
hid_t dtype;
char* dt_str;
size_t str_len;
TESTING3(" text for floating-point types");
if((dtype = H5LTtext_to_dtype("H5T_NATIVE_LDOUBLE\n", H5LT_DDL))<0)
goto out;
if(!H5Tequal(dtype, H5T_NATIVE_LDOUBLE))
goto out;
if(H5Tclose(dtype)<0)
goto out;
if((dtype = H5LTtext_to_dtype("H5T_IEEE_F32BE\n", H5LT_DDL))<0)
goto out;
if(!H5Tequal(dtype, H5T_IEEE_F32BE))
goto out;
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
dt_str = (char*)calloc(str_len, sizeof(char));
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
goto out;
if(strcmp(dt_str, "H5T_IEEE_F32BE"))
goto out;
free(dt_str);
if(H5Tclose(dtype)<0)
goto out;
if((dtype = H5LTtext_to_dtype("H5T_IEEE_F64LE\n", H5LT_DDL))<0)
goto out;
if(!H5Tequal(dtype, H5T_IEEE_F64LE))
goto out;
if(H5Tclose(dtype)<0)
goto out;
PASSED();
return 0;
out:
H5_FAILED();
return -1;
}
开发者ID:chaako,项目名称:sceptic3D,代码行数:50,代码来源:test_lite.c
示例10: test_integers
/*-------------------------------------------------------------------------
* subroutine for test_text_dtype(): test_integers().
*-------------------------------------------------------------------------
*/
static int test_integers(void)
{
hid_t dtype;
char* dt_str;
size_t str_len;
TESTING3("\n text for integer types");
if((dtype = H5LTtext_to_dtype("H5T_NATIVE_INT\n", H5LT_DDL))<0)
goto out;
if(!H5Tequal(dtype, H5T_NATIVE_INT))
goto out;
if(H5Tclose(dtype)<0)
goto out;
if((dtype = H5LTtext_to_dtype("H5T_STD_I8BE\n", H5LT_DDL))<0)
goto out;
if(!H5Tequal(dtype, H5T_STD_I8BE))
goto out;
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
dt_str = (char*)calloc(str_len, sizeof(char));
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
goto out;
if(strcmp(dt_str, "H5T_STD_I8BE"))
goto out;
free(dt_str);
if(H5Tclose(dtype)<0)
goto out;
if((dtype = H5LTtext_to_dtype("H5T_STD_U16LE\n", H5LT_DDL))<0)
goto out;
if(!H5Tequal(dtype, H5T_STD_U16LE))
goto out;
if(H5Tclose(dtype)<0)
goto out;
PASSED();
return 0;
out:
H5_FAILED();
return -1;
}
开发者ID:chaako,项目名称:sceptic3D,代码行数:50,代码来源:test_lite.c
示例11: max_value_of_type
inline size_t max_value_of_type (hid_t type)
{
if (H5Tequal(type, H5T_NATIVE_UCHAR)) {
return std::numeric_limits<uint8_t>::max();
} else
if (H5Tequal(type, H5T_NATIVE_USHORT)) {
return std::numeric_limits<uint16_t>::max();
} else
if (H5Tequal(type, H5T_NATIVE_UINT)) {
return std::numeric_limits<uint32_t>::max();
} else
if (H5Tequal(type, H5T_NATIVE_ULONG)) {
return std::numeric_limits<uint64_t>::max();
} else {
POMAGMA_ERROR("unknown type");
}
}
开发者ID:imclab,项目名称:pomagma,代码行数:17,代码来源:hdf5.hpp
示例12: compare_and_read_scalar_attribute_internal
void compare_and_read_scalar_attribute_internal(hid_t attribute_id, hid_t type_id, hid_t expected_type, void* buffer)
{
if(H5Tequal(type_id, expected_type))
{
herr_t status = H5Aread(attribute_id, type_id, buffer);
if(status >= 0)
return;
}
throw std::runtime_error("type mismatch");
}
开发者ID:klindworth,项目名称:cvwidgets,代码行数:10,代码来源:hdf5internals.cpp
示例13:
int H5mdfile::H5_write_value(int argc, char **argv, Tcl_Interp *interp)
{
/* Read value from Tcl and write it to dataset array */
// Get array index
int index=0;
if(dataset_rank>=1) index+=atoi(argv[4+dataset_rank-0]);
if(dataset_rank>=2) index+=atoi(argv[4+dataset_rank-1])*dims[dataset_rank-1];else goto label_index;
if(dataset_rank>=3) index+=atoi(argv[4+dataset_rank-2])*dims[dataset_rank-1]*dims[dataset_rank-2];else goto label_index;
if(dataset_rank>=4) index+=atoi(argv[4+dataset_rank-3])*dims[dataset_rank-1]*dims[dataset_rank-2]*dims[dataset_rank-3];else goto label_index;
if(dataset_rank>=5) index+=atoi(argv[4+dataset_rank-4])*dims[dataset_rank-1]*dims[dataset_rank-2]*dims[dataset_rank-3]*dims[dataset_rank-4];else goto label_index;
if(dataset_rank>=6) index+=atoi(argv[4+dataset_rank-5])*dims[dataset_rank-1]*dims[dataset_rank-2]*dims[dataset_rank-3]*dims[dataset_rank-4]*dims[dataset_rank-5];else goto label_index;
if(dataset_rank>=7) index+=atoi(argv[4+dataset_rank-6])*dims[dataset_rank-1]*dims[dataset_rank-2]*dims[dataset_rank-3]*dims[dataset_rank-4]*dims[dataset_rank-5]*dims[dataset_rank-6];else goto label_index;
if(dataset_rank>=8) index+=atoi(argv[4+dataset_rank-7])*dims[dataset_rank-1]*dims[dataset_rank-2]*dims[dataset_rank-3]*dims[dataset_rank-4]*dims[dataset_rank-5]*dims[dataset_rank-6]*dims[dataset_rank-7];else goto label_index;
label_index:
// Write single value from Tcl to dataset array
if(H5Tequal(dataset_type_id, H5T_NATIVE_FLOAT))
{
dset_data_float = static_cast<float*>(dset_data);
dset_data_float[index]=(float)atof(argv[3]);
}
if(H5Tequal(dataset_type_id, H5T_NATIVE_DOUBLE))
{
dset_data_double = static_cast<double*>(dset_data);
dset_data_double[index]=atof(argv[3]);
}
if(H5Tequal(dataset_type_id, H5T_NATIVE_INT))
{
dset_data_int = static_cast<int*>(dset_data);
dset_data_int[index]=atoi(argv[3]);
}
if(H5Tis_variable_str(dataset_type_id)!=0)
{
// dset_data_string = static_cast<h5string*>(dset_data);
// dset_data_chars=static_cast<char *>(dset_data);
dset_data_chars=(char**) dset_data;
dset_data_chars[index]=strdup(argv[3]);
}
return TCL_OK;
}
开发者ID:gitter-badger,项目名称:espresso,代码行数:40,代码来源:h5mdfile_tcl.cpp
示例14: _MED21attrNumLire
med_err _MED21attrNumLire(med_idt pere,med_type_champ type,char *nom,
unsigned char *val,hid_t hdf_file)
{
med_idt attid;
med_err ret;
int type_hdf;
if ((attid = H5Aopen_name(pere,nom)) < 0)
return -1;
switch(type)
{
case MED_FLOAT64 :
if (H5Tequal(hdf_file,H5T_IEEE_F64BE))
type_hdf = H5T_IEEE_F64LE;
if (H5Tequal(hdf_file,H5T_IEEE_F64LE))
type_hdf = H5T_IEEE_F64BE;
break;
case MED_INT :
#if defined(HAVE_F77INT64)
type_hdf = H5T_NATIVE_LONG;
#else
type_hdf = H5T_NATIVE_INT;
#endif
break;
default :
return -1;
}
if ((ret = H5Aread(attid,type_hdf,val)) < 0)
return -1;
if ((ret = H5Aclose(attid)) < 0)
return -1;
return 0;
}
开发者ID:vejmarie,项目名称:libMED,代码行数:39,代码来源:MED21attrNumLire.c
示例15: gridReaderHDF5_readIntoPatchForVar
extern void
gridReaderHDF5_readIntoPatchForVar(gridReader_t reader,
gridPatch_t patch,
int idxOfVar)
{
assert(reader != NULL);
assert(reader->type = GRIDIO_TYPE_HDF5);
assert(patch != NULL);
assert(idxOfVar >= 0 && idxOfVar < gridPatch_getNumVars(patch));
hid_t dataSet;
hid_t dataSpaceFile, dataTypeFile;
hid_t dataSpacePatch, dataTypePatch;
gridPointUint32_t idxLoPatch, dimsPatch;
dataVar_t var = gridPatch_getVarHandle(patch, idxOfVar);
void *data = gridPatch_getVarDataHandle(patch, idxOfVar);
gridPatch_getIdxLo(patch, idxLoPatch);
gridPatch_getDims(patch, dimsPatch);
dataSet = H5Dopen(((gridReaderHDF5_t)reader)->file,
dataVar_getName(var), H5P_DEFAULT);
dataTypeFile = H5Dget_type(dataSet);
dataSpaceFile = H5Dget_space(dataSet);
dataTypePatch = dataVar_getHDF5Datatype(var);
dataSpacePatch = gridUtilHDF5_getDataSpaceFromDims(dimsPatch);
gridUtilHDF5_selectHyperslab(dataSpaceFile, idxLoPatch, dimsPatch);
if (H5Tequal(dataTypeFile, dataTypePatch)) {
H5Dread(dataSet, dataTypeFile, dataSpacePatch,
dataSpaceFile, H5P_DEFAULT, data);
} else {
fprintf(stderr, "ERROR: Datatype in memory differs from file.\n");
diediedie(EXIT_FAILURE);
}
H5Sclose(dataSpacePatch);
H5Tclose(dataTypePatch);
H5Sclose(dataSpaceFile);
H5Tclose(dataTypeFile);
H5Dclose(dataSet);
} /* gridReaderHDF5_readIntoPatchForVar */
开发者ID:satlank,项目名称:ginnungagap,代码行数:44,代码来源:gridReaderHDF5.c
示例16: e5_convert_hdf_type
static int
e5_convert_hdf_type(hid_t e5_type_id)
{
if(H5Tequal(e5_type_id, H5T_STD_I32LE))
return E5_TYPE_INT;
else if(H5Tequal(e5_type_id, H5T_NATIVE_INT))
return E5_TYPE_INT;
else if(H5Tequal(e5_type_id, H5T_IEEE_F32LE))
return E5_TYPE_FLOAT;
else if(H5Tequal(e5_type_id, H5T_NATIVE_FLOAT))
return E5_TYPE_FLOAT;
else if(H5Tequal(e5_type_id, H5T_IEEE_F64LE))
return E5_TYPE_DOUBLE;
else if(H5Tequal(e5_type_id, H5T_NATIVE_DOUBLE))
return E5_TYPE_DOUBLE;
else if(H5Tequal(e5_type_id, H5T_C_S1 ))
return E5_TYPE_FIXED_SIZE_STR;
else
return E5_TYPE_INVALID;
return E5_TYPE_INVALID;
}
开发者ID:voidcycles,项目名称:void,代码行数:22,代码来源:e5.c
示例17: genType
static CollectionType* genType(hid_t datatype_id)
{
bool found = false;
H5T_class_t h5_class = H5Tget_class(datatype_id);
if(h5_class == H5T_ARRAY)
{
hid_t base = H5Tget_super(datatype_id);
if(H5Tequal(base, H5T_NATIVE_HSIZE) == 1)
{
if(H5Tget_array_ndims(datatype_id) == 1)
{
hsize_t adims_out[1];
H5Tget_array_dims(datatype_id, adims_out);
if(adims_out[0] == 3)
found = true;
}
}
H5Tclose(base);
}
if(found)
return new ColTypeDimArray;
else
return NULL;
}
开发者ID:ComputationalRadiationPhysics,项目名称:libSplash,代码行数:24,代码来源:ColTypeDimArray.hpp
示例18: print_type
/*-------------------------------------------------------------------------
* Function: print_type
*
* Purpose: Print name of datatype
*
* Return: void
*
* Programmer: Pedro Vicente, [email protected]
*
* Date: May 9, 2003
*
* Comments: Adapted from h5dump for H5T_INTEGER and H5T_FLOAT classes only
*
*-------------------------------------------------------------------------
*/
void print_type(hid_t type)
{
switch (H5Tget_class(type))
{
default:
return;
case H5T_INTEGER:
if (H5Tequal(type, H5T_STD_I8BE)) {
printf("H5T_STD_I8BE");
} else if (H5Tequal(type, H5T_STD_I8LE)) {
printf("H5T_STD_I8LE");
} else if (H5Tequal(type, H5T_STD_I16BE)) {
printf("H5T_STD_I16BE");
} else if (H5Tequal(type, H5T_STD_I16LE)) {
printf("H5T_STD_I16LE");
} else if (H5Tequal(type, H5T_STD_I32BE)) {
printf("H5T_STD_I32BE");
} else if (H5Tequal(type, H5T_STD_I32LE)) {
printf("H5T_STD_I32LE");
} else if (H5Tequal(type, H5T_STD_I64BE)) {
printf("H5T_STD_I64BE");
} else if (H5Tequal(type, H5T_STD_I64LE)) {
printf("H5T_STD_I64LE");
} else if (H5Tequal(type, H5T_STD_U8BE)) {
printf("H5T_STD_U8BE");
} else if (H5Tequal(type, H5T_STD_U8LE)) {
printf("H5T_STD_U8LE");
} else if (H5Tequal(type, H5T_STD_U16BE)) {
printf("H5T_STD_U16BE");
} else if (H5Tequal(type, H5T_STD_U16LE)) {
printf("H5T_STD_U16LE");
} else if (H5Tequal(type, H5T_STD_U32BE)) {
printf("H5T_STD_U32BE");
} else if (H5Tequal(type, H5T_STD_U32LE)) {
printf("H5T_STD_U32LE");
} else if (H5Tequal(type, H5T_STD_U64BE)) {
printf("H5T_STD_U64BE");
} else if (H5Tequal(type, H5T_STD_U64LE)) {
printf("H5T_STD_U64LE");
} else if (H5Tequal(type, H5T_NATIVE_SCHAR)) {
printf("H5T_NATIVE_SCHAR");
} else if (H5Tequal(type, H5T_NATIVE_UCHAR)) {
printf("H5T_NATIVE_UCHAR");
} else if (H5Tequal(type, H5T_NATIVE_SHORT)) {
printf("H5T_NATIVE_SHORT");
} else if (H5Tequal(type, H5T_NATIVE_USHORT)) {
printf("H5T_NATIVE_USHORT");
} else if (H5Tequal(type, H5T_NATIVE_INT)) {
printf("H5T_NATIVE_INT");
} else if (H5Tequal(type, H5T_NATIVE_UINT)) {
printf("H5T_NATIVE_UINT");
} else if (H5Tequal(type, H5T_NATIVE_LONG)) {
printf("H5T_NATIVE_LONG");
} else if (H5Tequal(type, H5T_NATIVE_ULONG)) {
printf("H5T_NATIVE_ULONG");
} else if (H5Tequal(type, H5T_NATIVE_LLONG)) {
printf("H5T_NATIVE_LLONG");
} else if (H5Tequal(type, H5T_NATIVE_ULLONG)) {
printf("H5T_NATIVE_ULLONG");
} else {
printf("undefined integer");
}
break;
case H5T_FLOAT:
if (H5Tequal(type, H5T_IEEE_F32BE)) {
printf("H5T_IEEE_F32BE");
} else if (H5Tequal(type, H5T_IEEE_F32LE)) {
printf("H5T_IEEE_F32LE");
} else if (H5Tequal(type, H5T_IEEE_F64BE)) {
printf("H5T_IEEE_F64BE");
} else if (H5Tequal(type, H5T_IEEE_F64LE)) {
printf("H5T_IEEE_F64LE");
} else if (H5Tequal(type, H5T_NATIVE_FLOAT)) {
printf("H5T_NATIVE_FLOAT");
} else if (H5Tequal(type, H5T_NATIVE_DOUBLE)) {
printf("H5T_NATIVE_DOUBLE");
#if H5_SIZEOF_LONG_DOUBLE !=0
} else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) {
printf("H5T_NATIVE_LDOUBLE");
#endif
} else {
printf("undefined float");
}
break;
//.........这里部分代码省略.........
开发者ID:MattNapsAlot,项目名称:rHDF5,代码行数:101,代码来源:h5diff_util.c
示例19: qDebug
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
IDataArray::Pointer H5DataArrayReader::ReadNeighborListData(hid_t gid, const QString& name, bool metaDataOnly)
{
herr_t err = -1;
hid_t typeId = -1;
H5T_class_t attr_type;
size_t attr_size;
QString res;
QVector<hsize_t> dims; //Reusable for the loop
IDataArray::Pointer iDataArray = IDataArray::NullPointer();
//qDebug() << "Reading Attribute " << *iter ;
typeId = QH5Lite::getDatasetType(gid, name);
err = QH5Lite::getDatasetInfo(gid, name, dims, attr_type, attr_size);
if(err < 0)
{
qDebug() << "Error in getAttributeInfo method in readUserMetaData." ;
}
else
{
QString classType;
int version = 0;
QVector<size_t> tDims;
QVector<size_t> cDims;
err = ReadRequiredAttributes(gid, name, classType, version, tDims, cDims);
if(err < 0)
{
return iDataArray;
}
switch(attr_type)
{
case H5T_STRING:
res.clear(); //Clear the string out first
err = QH5Lite::readStringDataset(gid, name, res);
break;
case H5T_INTEGER:
if(H5Tequal(typeId, H5T_STD_U8BE) || H5Tequal(typeId, H5T_STD_U8LE))
{
NeighborList<uint8_t>::Pointer ptr = NeighborList<uint8_t>::CreateArray(tDims, cDims, name, false);
if(false == metaDataOnly)
{
ptr->readH5Data(gid);
}
iDataArray = ptr;
}
else if(H5Tequal(typeId, H5T_STD_U16BE) || H5Tequal(typeId, H5T_STD_U16LE))
{
NeighborList<uint16_t>::Pointer ptr = NeighborList<uint16_t>::CreateArray(tDims, cDims, name, false);
if(false == metaDataOnly)
{
ptr->readH5Data(gid);
}
iDataArray = ptr;
}
else if(H5Tequal(typeId, H5T_STD_U32BE) || H5Tequal(typeId, H5T_STD_U32LE))
{
NeighborList<uint32_t>::Pointer ptr = NeighborList<uint32_t>::CreateArray(tDims, cDims, name, false);
if(false == metaDataOnly)
{
ptr->readH5Data(gid);
}
iDataArray = ptr;
}
else if(H5Tequal(typeId, H5T_STD_U64BE) || H5Tequal(typeId, H5T_STD_U64LE))
{
NeighborList<uint64_t>::Pointer ptr = NeighborList<uint64_t>::CreateArray(tDims, cDims, name, false);
if(false == metaDataOnly)
{
ptr->readH5Data(gid);
}
iDataArray = ptr;
}
else if(H5Tequal(typeId, H5T_STD_I8BE) || H5Tequal(typeId, H5T_STD_I8LE))
{
NeighborList<int8_t>::Pointer ptr = NeighborList<int8_t>::CreateArray(tDims, cDims, name, false);
if(false == metaDataOnly)
{
ptr->readH5Data(gid);
}
iDataArray = ptr;
}
else if(H5Tequal(typeId, H5T_STD_I16BE) || H5Tequal(typeId, H5T_STD_I16LE))
{
NeighborList<int16_t>::Pointer ptr = NeighborList<int16_t>::CreateArray(tDims, cDims, name, false);
if(false == metaDataOnly)
{
ptr->readH5Data(gid);
}
iDataArray = ptr;
}
else if(H5Tequal(typeId, H5T_STD_I32BE) || H5Tequal(typeId, H5T_STD_I32LE))
{
NeighborList<int32_t>::Pointer ptr = NeighborList<int32_t>::CreateArray(tDims, cDims, name, false);
if(false == metaDataOnly)
//.........这里部分代码省略.........
开发者ID:ravishivaraman,项目名称:DREAM3D,代码行数:101,代码来源:H5DataArrayReader.cpp
示例20: if
const char *HDF5Dataset::GetDataTypeName(hid_t TypeID)
{
if( H5Tequal( H5T_NATIVE_CHAR, TypeID ) )
return "8-bit character";
else if( H5Tequal( H5T_NATIVE_UCHAR, TypeID ) )
return "8-bit unsigned character";
else if( H5Tequal( H5T_NATIVE_SHORT, TypeID ) )
return "16-bit integer";
else if( H5Tequal( H5T_NATIVE_USHORT, TypeID ) )
return "16-bit unsigned integer";
else if( H5Tequal( H5T_NATIVE_INT, TypeID ) )
return "32-bit integer";
else if( H5Tequal( H5T_NATIVE_UINT, TypeID ) )
return "32-bit unsigned integer";
else if( H5Tequal( H5T_NATIVE_LONG, TypeID ) )
return "32/64-bit integer";
else if( H5Tequal( H5T_NATIVE_ULONG, TypeID ) )
return "32/64-bit unsigned integer";
else if( H5Tequal( H5T_NATIVE_FLOAT, TypeID ) )
return "32-bit floating-point";
else if( H5Tequal( H5T_NATIVE_DOUBLE, TypeID ) )
return "64-bit floating-point";
else if( H5Tequal( H5T_NATIVE_LLONG, TypeID ) )
return "64-bit integer";
else if( H5Tequal( H5T_NATIVE_ULLONG, TypeID ) )
return "64-bit unsigned integer";
else if( H5Tequal( H5T_NATIVE_DOUBLE, TypeID ) )
return "64-bit floating-point";
return "Unknown";
}
开发者ID:dlsyaim,项目名称:osgEarthX,代码行数:31,代码来源:hdf5dataset.cpp
注:本文中的H5Tequal函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论