36 throw cms::Exception(
"UnknownH5Group") <<
"unable to find group " << iName;
40 Group::Group(hid_t iParentID,
const void* iRef) : id_(H5Rdereference2(iParentID, H5P_DEFAULT, H5R_OBJECT, iRef)) {
42 throw cms::Exception(
"BadH5GroupRef") <<
"unable to dereference Group from parent " << iParentID;
73 return std::make_shared<Group>(
id_, iName);
76 return std::make_shared<DataSet>(
id_, iName);
80 return std::make_shared<Attribute>(
id_, iName);
83 std::shared_ptr<Group>
Group::derefGroup(hobj_ref_t iRef)
const {
return std::make_shared<Group>(
id_, &iRef); }
85 std::shared_ptr<DataSet>
Group::derefDataSet(hobj_ref_t iRef)
const {
return std::make_shared<DataSet>(
id_, &iRef); }
88 ssize_t name_size = H5Iget_name(
id_,
nullptr, 0);
90 size_t actual_name_size =
static_cast<size_t>(name_size) + 1;
91 std::unique_ptr<char[]>
buffer(
new char[actual_name_size]);
92 H5Iget_name(
id_,
buffer.get(), actual_name_size);
100 herr_t ret_value = H5Gget_info(
id_, &ginfo);
102 return (ginfo.nlinks);
107 ssize_t name_len = H5Lget_name_by_idx(
id_,
".", H5_INDEX_NAME, H5_ITER_INC,
idx,
nullptr, 0, H5P_DEFAULT);
112 size_t actual_name_len =
static_cast<size_t>(name_len) + 1;
114 std::unique_ptr<char[]>
buffer(
new char[actual_name_len]);
116 (
void)H5Lget_name_by_idx(
id_,
".", H5_INDEX_NAME, H5_ITER_INC,
idx,
buffer.get(), actual_name_len, H5P_DEFAULT);
std::shared_ptr< Group > findGroup(std::string const &iName) const
std::string getObjnameByIdx(std::size_t) const
std::size_t getNumObjs() const
Group(hid_t, std::string const &)
TEMPL(T2) struct Divides void
std::shared_ptr< DataSet > findDataSet(std::string const &iName) const
std::shared_ptr< Group > derefGroup(hobj_ref_t iRef) const
std::shared_ptr< Attribute > findAttribute(std::string const &iName) const
std::shared_ptr< DataSet > derefDataSet(hobj_ref_t iRef) const