1 #include "../icedb/Group.hpp" 2 #include "../private/hdf5_load.h" 3 #include "../private/hdf5_supplemental.hpp" 4 #include "../private/Group_impl.hpp" 5 #include "../icedb/compat/gsl/gsl_assert" 24 grp = std::shared_ptr<H5::Group>(ugrp.release());
33 grp = std::shared_ptr<H5::Group>(ugrp.release());
44 grp = std::shared_ptr<H5::Group>(ugrp.release());
66 template<
class HPo
interType>
69 hid_t baseGrpID = parent->getId();
74 hid_t gcpl_id = H5Pcreate(H5P_GROUP_CREATE);
76 assert(H5Pset_link_creation_order(gcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) >= 0);
77 assert(H5Pset_attr_creation_order(gcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) >= 0);
78 hid_t newGrp_id = H5Gcreate2(baseGrpID, groupName.c_str(), H5P_DEFAULT, gcpl_id, H5P_DEFAULT);
79 assert(newGrp_id >= 0);
80 assert(H5Gclose(newGrp_id) >= 0);
81 assert(H5Pclose(gcpl_id) >= 0);
83 return std::make_unique<Group_impl>(groupName,
parent);
86 #if ICEDB_H5_UNIFIED_GROUP_FILE == 1 88 return _Impl_createGroup<ICEDB_H5_GROUP_OWNER>(groupName,
parent);
92 return _Impl_createGroup<H5::Group>(groupName,
parent);
96 return _Impl_createGroup<H5::H5File>(groupName,
parent);
108 return std::make_unique<Group_impl>(groupName,
grp.get());
113 #if ICEDB_H5_UNIFIED_GROUP_FILE == 1 115 return std::make_unique<Group_impl>(
name,
parent);
120 return std::make_unique<Group_impl>(
name,
parent);
124 return std::make_unique<Group_impl>(
name,
parent);
131 return std::make_unique<Group_impl>(
parent);
139 grp->unlink(groupName);
144 if (gnames.count(groupName))
return true;
150 std::set<std::string> res;
151 for (
const auto &o : objs)
153 if (o.second == H5G_obj_t::H5G_GROUP) res.insert(o.first);
159 gsl::not_null<const Group*> containingParent,
160 gsl::not_null<H5::H5File*> pointsTo)
164 H5::PropList pl(H5P_DEFAULT);
165 containingParent->getHDF5Group()->mount(subdirname, *(pointsTo.get()), pl);
166 return openGroup(subdirname, containingParent);
Group::Group_ptr _Impl_createGroup(const std::string &groupName, gsl::not_null< HPointerType *> parent)
This exists because HDF5's API changed.
std::set< std::string > getGroupNames() const override
std::shared_ptr< H5::Group > Group_HDF_shared_ptr
Group_HDF_shared_ptr getHDF5Group() const override
Get the fundamental HDF5 object that the group is built on.
virtual void _setAttributeParent(std::shared_ptr< H5::H5Object > obj) override
A group is similar to a folder / directory. It can have Attributes and Tables.
virtual Group_ptr createGroup(const std::string &groupName)=0
Create a group.
void _setTablesParent(std::shared_ptr< H5::Group > obj) override
CanHaveTables needs post-constructor setup. This sets the base HDF5 object that gets manipulated...
virtual Group_ptr openGroup(const std::string &groupName) const =0
Opens a group.
bool doesGroupExist(const std::string &groupName) const override
Does a group with this name exist?
HDFgroup_t openGroup(gsl::not_null< ICEDB_H5_GROUP_OWNER_PTR > base, gsl::not_null< const char *> name)
std::unique_ptr< Groups::Group > Group_ptr
Group_ptr openGroup(const std::string &groupName) const override
Opens a group.
Group_ptr createGroup(const std::string &groupName) override
Create a group.
std::shared_ptr< H5::H5Object > parent
static Group_ptr mount(const std::string &subdirname, gsl::not_null< const Group *> containingParent, gsl::not_null< H5::H5File *> pointsTo)
Mount an HDF5 file as a child 'group'.
void deleteGroup(const std::string &groupName) override
Unlink the specified child group.
std::map< std::string, H5G_obj_t > getGroupMembersTypes(const ICEDB_H5_GETNUMOBJS_OWNER &base)
static const std::string _icedb_obj_type_identifier
The tag used in icedb to identify a group.
const std::string name
The name of the group.