My Project 1.10.10
Loading...
Searching...
No Matches
H5Object.h
1// C++ informative line for the emacs editor: -*- C++ -*-
2/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3 * Copyright by The HDF Group. *
4 * All rights reserved. *
5 * *
6 * This file is part of HDF5. The full HDF5 copyright notice, including *
7 * terms governing use, modification, and redistribution, is contained in *
8 * the COPYING file, which can be found at the root of the source code *
9 * distribution tree, or in https://www.hdfgroup.org/licenses. *
10 * If you do not have access to either file, you may request a copy from *
11 * help@hdfgroup.org. *
12 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13
14#ifndef H5Object_H
15#define H5Object_H
16
17namespace H5 {
18
39// Inheritance: H5Location -> IdComponent
40
41// Define the operator function pointer for H5Aiterate().
42typedef void (*attr_operator_t)(H5Object &loc, const H5std_string attr_name, void *operator_data);
43
44// Define the operator function pointer for H5Ovisit2().
45typedef int (*visit_operator_t)(H5Object &obj, const H5std_string attr_name, const H5O_info_t *oinfo,
46 void *operator_data);
47
48// User data for attribute iteration
50 public:
52 void *opData;
53 H5Object *location; // Consider changing to H5Location
54};
55
56// User data for visit iteration
63
64class H5_DLLCPP H5Object : public H5Location {
65 public:
66 // Creates an attribute for the specified object
67 // PropList is currently not used, so always be default.
68 Attribute createAttribute(const char *name, const DataType &type, const DataSpace &space,
69 const PropList &create_plist = PropList::DEFAULT) const;
70 Attribute createAttribute(const H5std_string &name, const DataType &type, const DataSpace &space,
71 const PropList &create_plist = PropList::DEFAULT) const;
72
73 // Given its name, opens the attribute that belongs to an object at
74 // this location.
75 Attribute openAttribute(const char *name) const;
76 Attribute openAttribute(const H5std_string &name) const;
77
78 // Given its index, opens the attribute that belongs to an object at
79 // this location.
80 Attribute openAttribute(const unsigned int idx) const;
81
82 // Iterate user's function over the attributes of this object.
83 int iterateAttrs(attr_operator_t user_op, unsigned *idx = NULL, void *op_data = NULL);
84
85 // Recursively visit elements reachable from this object.
86 void visit(H5_index_t idx_type, H5_iter_order_t order, visit_operator_t user_op, void *op_data,
87 unsigned int fields);
88
89 // Returns the object header version of an object
90 unsigned objVersion() const;
91
92 // Determines the number of attributes belong to this object.
93 int getNumAttrs() const;
94
95 // Checks whether the named attribute exists for this object.
96 bool attrExists(const char *name) const;
97 bool attrExists(const H5std_string &name) const;
98
99 // Renames the named attribute to a new name.
100 void renameAttr(const char *oldname, const char *newname) const;
101 void renameAttr(const H5std_string &oldname, const H5std_string &newname) const;
102
103 // Removes the named attribute from this object.
104 void removeAttr(const char *name) const;
105 void removeAttr(const H5std_string &name) const;
106
107 // Returns an identifier.
108 virtual hid_t getId() const H5_OVERRIDE = 0;
109
110 // Gets the name of this HDF5 object, i.e., Group, DataSet, or
111 // DataType.
112 ssize_t getObjName(char *obj_name, size_t buf_size = 0) const;
113 ssize_t getObjName(H5std_string &obj_name, size_t len = 0) const;
114 H5std_string getObjName() const;
115
116#ifndef DOXYGEN_SHOULD_SKIP_THIS
117
118 protected:
119 // Default constructor
120 H5Object();
121
122 // Sets the identifier of this object to a new value. - this one
123 // doesn't increment reference count
124 virtual void p_setId(const hid_t new_id) H5_OVERRIDE = 0;
125
126 // Noop destructor.
127 virtual ~H5Object() H5_OVERRIDE;
128
129#endif // DOXYGEN_SHOULD_SKIP_THIS
130
131}; // end of H5Object
132} // namespace H5
133
134#endif // H5Object_H
Class Attribute operates on HDF5 attributes.
Definition H5Attribute.h:28
Class DataSpace inherits from IdComponent and provides wrappers for the HDF5's dataspaces.
Definition H5DataSpace.h:24
Class DataType provides generic operations on HDF5 datatypes.
Definition H5DataType.h:27
H5Location is an abstract base class, added in version 1.8.12.
Definition H5Location.h:30
Class H5Object is a bridge between H5Location and DataSet, DataType, and Group.
Definition H5Object.h:64
virtual hid_t getId() const H5_OVERRIDE=0
Class PropList inherits from IdComponent and provides wrappers for the HDF5 generic property list.
Definition H5PropList.h:24
Definition H5Object.h:49
void * opData
Definition H5Object.h:52
H5Object * location
Definition H5Object.h:53
attr_operator_t op
Definition H5Object.h:51
Definition H5Object.h:57
void * opData
Definition H5Object.h:60
visit_operator_t op
Definition H5Object.h:59
H5Object * obj
Definition H5Object.h:61
Definition H5AbstractDs.cpp:33
int(* visit_operator_t)(H5Object &obj, const H5std_string attr_name, const H5O_info_t *oinfo, void *operator_data)
Definition H5Object.h:45
void(* attr_operator_t)(H5Object &loc, const H5std_string attr_name, void *operator_data)
Definition H5Object.h:42


The HDF Group Help Desk:
  Copyright by The HDF Group