icedb  version 0.5.1
Snow particle scattering database API
Group.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <memory>
3 #include <set>
4 #include "compat/gsl/gsl"
5 #include "Attribute.hpp"
6 #include "Table.hpp"
7 #include "util.hpp"
8 #include "icedb_h5.h"
9 namespace H5 {
10  class Group;
11  class H5File;
12 }
13 namespace icedb {
15  namespace Groups {
16 #ifdef _MSC_FULL_VER
17 #pragma warning( push )
18 #pragma warning(disable:4250)
19 #endif
20 
22  class Group : virtual public Attributes::CanHaveAttributes, virtual public Tables::CanHaveTables
23  {
24  protected:
25  Group();
26  Group(const std::string &name);
27  public:
29  static const std::string _icedb_obj_type_identifier;
30  typedef std::unique_ptr<Groups::Group> Group_ptr;
31  //typedef std::unique_ptr<Groups::Group, mem::icedb_delete<Groups::Group> > Group_ptr;
32  typedef std::shared_ptr<H5::Group> Group_HDF_shared_ptr;
34  const std::string name;
35 
36  virtual ~Group();
42  virtual Group_ptr createGroup(const std::string &groupName) = 0;
47  virtual Group_ptr openGroup(const std::string &groupName) const = 0;
52  virtual bool doesGroupExist(const std::string &groupName) const = 0;
55  virtual std::set<std::string> getGroupNames() const = 0;
60  virtual void deleteGroup(const std::string &groupName) = 0;
62  virtual Group_HDF_shared_ptr getHDF5Group() const = 0;
63 
64 
65 #if ICEDB_H5_UNIFIED_GROUP_FILE == 1
66  static Group_ptr createGroup(const std::string &name, gsl::not_null<ICEDB_H5_GROUP_OWNER_PTR> parent);
74 #else
75  static Group_ptr createGroup(const std::string &name, gsl::not_null<H5::Group*> parent);
90  static Group_ptr createGroup(const std::string &name, gsl::not_null<H5::H5File*> parent);
91 #endif
92  static Group_ptr createGroup(const std::string &name, gsl::not_null<const Group*> parent);
100 
101 #if ICEDB_H5_UNIFIED_GROUP_FILE == 1
102  static Group_ptr openGroup(const std::string &name, gsl::not_null<ICEDB_H5_GROUP_OWNER_PTR> parent);
109 #else
110  static Group_ptr openGroup(const std::string &name, gsl::not_null<H5::Group*> parent);
123  static Group_ptr openGroup(const std::string &name, gsl::not_null<H5::H5File*> parent);
124 #endif
125  static Group_ptr openGroup(const std::string &name, gsl::not_null<const Group*> parent);
134  static Group_ptr openGroup(Group_HDF_shared_ptr group);
135 
142  static Group_ptr mount(const std::string &subdirname, gsl::not_null<const Group*> containingParent, gsl::not_null<H5::H5File*> pointsTo);
143  };
144 
145 #ifdef _MSC_FULL_VER
146 #pragma warning( pop )
147 #endif
148  }
149 }
Definition: Data_Types.hpp:9
The virtual base class used in all objects that can contain tables (groups and datasets).
Definition: Table.hpp:126
std::shared_ptr< H5::Group > Group_HDF_shared_ptr
Definition: Group.hpp:32
A group is similar to a folder / directory. It can have Attributes and Tables.
Definition: Group.hpp:22
This is a virtual base class for objects that can have attributes. This includes tables, groups and HDF5 files.
Definition: Attribute.hpp:61
HDFgroup_t openGroup(gsl::not_null< ICEDB_H5_GROUP_OWNER_PTR > base, gsl::not_null< const char *> name)
Definition: export-hdf5.cpp:75
std::unique_ptr< Groups::Group > Group_ptr
Definition: Group.hpp:30
static const std::string _icedb_obj_type_identifier
The tag used in icedb to identify a group.
Definition: Group.hpp:29
const std::string name
The name of the group.
Definition: Group.hpp:34