Miscellaneous improvements

Description:
    Moved H5Location::getNumObjs to Group::getNumObjs (i.e., H5Gget_info)
    Switched reinterpret_cast to static_cast in H5Object::iterateAttrs
    Miscellaneous cleanup
Platforms tested:
    Linux/32 2.6 (jam)
    Linux/64 (platypus)
    Darwin (osx1010test)
This commit is contained in:
Binh-Minh Ribler
2017-08-24 13:46:39 -05:00
parent a6d5bf1a86
commit 0e44181bbb
7 changed files with 71 additions and 69 deletions

View File

@@ -44,10 +44,10 @@ namespace H5 {
extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name,
const H5A_info_t *ainfo, void *op_data)
{
H5std_string s_attr_name = H5std_string(attr_name);
UserData4Aiterate* myData = reinterpret_cast<UserData4Aiterate *> (op_data);
myData->op(*myData->location, s_attr_name, myData->opData);
return 0;
H5std_string s_attr_name = H5std_string(attr_name);
UserData4Aiterate* myData = reinterpret_cast<UserData4Aiterate *> (op_data);
myData->op(*myData->location, s_attr_name, myData->opData);
return 0;
}
//--------------------------------------------------------------------------
@@ -81,6 +81,7 @@ H5Object::H5Object() : H5Location() {}
// This constructor is no longer appropriate because the data member "id" had
// been moved to the sub-classes. It is removed from 1.8.15 because it is
// a noop and it can be generated by the compiler if needed.
// Removed in 1.10.1 - Aug 2016
//--------------------------------------------------------------------------
// H5Object::H5Object(const H5Object& original) : H5Location() {}
@@ -148,7 +149,7 @@ Attribute H5Object::createAttribute(const char* name, const DataType& data_type,
//--------------------------------------------------------------------------
Attribute H5Object::createAttribute(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist) const
{
return(createAttribute( name.c_str(), data_type, data_space, create_plist));
return(createAttribute(name.c_str(), data_type, data_space, create_plist));
}
//--------------------------------------------------------------------------
@@ -183,7 +184,7 @@ Attribute H5Object::openAttribute(const char* name) const
//--------------------------------------------------------------------------
Attribute H5Object::openAttribute(const H5std_string& name) const
{
return(openAttribute( name.c_str()));
return(openAttribute(name.c_str()));
}
//--------------------------------------------------------------------------
@@ -239,7 +240,7 @@ int H5Object::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_dat
// call the C library routine H5Aiterate2 to iterate the attributes
hsize_t idx = _idx ? static_cast<hsize_t>(*_idx) : 0;
int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx,
userAttrOpWrpr, reinterpret_cast<void *>(userData));
userAttrOpWrpr, static_cast<void *>(userData));
// release memory
delete userData;