summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Group.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++/src/H5Group.cpp')
-rw-r--r--c++/src/H5Group.cpp57
1 files changed, 49 insertions, 8 deletions
diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp
index 6ae7cf7..02d9338 100644
--- a/c++/src/H5Group.cpp
+++ b/c++/src/H5Group.cpp
@@ -33,6 +33,7 @@
#include "H5DataSpace.h"
#include "H5DataSet.h"
#include "H5CommonFG.h"
+#include "H5Attribute.h"
#include "H5Group.h"
#include "H5File.h"
#include "H5Alltypes.h"
@@ -88,22 +89,62 @@ Group::Group(const hid_t existing_id) : H5Object()
//--------------------------------------------------------------------------
// Function: Group overload constructor - dereference
-///\brief Given a reference to some object, returns that group
-/// obj - IN: Location reference object is in
+///\brief Given a reference, ref, to an hdf5 group, creates a Group object
+///\param obj - IN: Specifying location referenced object is in
///\param ref - IN: Reference pointer
-///\parDescription
-/// \c obj can be DataSet, Group, H5File, or named DataType, that
+///\param ref_type - IN: Reference type - default to H5R_OBJECT
+///\exception H5::ReferenceException
+///\par Description
+/// \c obj can be DataSet, Group, or named DataType, that
/// is a datatype that has been named by DataType::commit.
// Programmer Binh-Minh Ribler - Oct, 2006
//--------------------------------------------------------------------------
-Group::Group(H5Object& obj, void* ref) : H5Object()
+Group::Group(H5Object& obj, const void* ref, H5R_type_t ref_type) : H5Object()
{
- id = obj.p_dereference(ref);
+ try {
+ id = p_dereference(obj.getId(), ref, ref_type);
+ } catch (ReferenceException deref_error) {
+ throw ReferenceException("Group constructor - located by an H5Object",
+ deref_error.getDetailMsg());
+ }
}
-Group::Group(H5File& h5file, void* ref) : H5Object()
+//--------------------------------------------------------------------------
+// Function: Group overload constructor - dereference
+///\brief Given a reference, ref, to an hdf5 group, creates a Group object
+///\param h5file - IN: Location referenced object is in
+///\param ref - IN: Reference pointer
+///\param ref_type - IN: Reference type - default to H5R_OBJECT
+///\exception H5::ReferenceException
+// Programmer Binh-Minh Ribler - Oct, 2006
+//--------------------------------------------------------------------------
+Group::Group(H5File& h5file, const void* ref, H5R_type_t ref_type) : H5Object()
{
- id = h5file.p_dereference(ref);
+ try {
+ id = p_dereference(h5file.getId(), ref, ref_type);
+ } catch (ReferenceException deref_error) {
+ throw ReferenceException("Group constructor - located by an H5File",
+ deref_error.getDetailMsg());
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: Group overload constructor - dereference
+///\brief Given a reference, ref, to an hdf5 group, creates a Group object
+///\param attr - IN: Specifying location where the referenced object is in
+///\param ref - IN: Reference pointer
+///\param ref_type - IN: Reference type - default to H5R_OBJECT
+///\exception H5::ReferenceException
+// Programmer Binh-Minh Ribler - Oct, 2006
+//--------------------------------------------------------------------------
+Group::Group(Attribute& attr, const void* ref, H5R_type_t ref_type) : H5Object()
+{
+ try {
+ id = p_dereference(attr.getId(), ref, ref_type);
+ } catch (ReferenceException deref_error) {
+ throw ReferenceException("Group constructor - located by an Attribute",
+ deref_error.getDetailMsg());
+ }
}
#ifndef H5_NO_DEPRECATED_SYMBOLS