summaryrefslogtreecommitdiffstats
path: root/c++/src/H5LaccProp.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2017-03-14 03:53:43 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2017-03-14 03:53:43 (GMT)
commita48c9c4024e7ede0021e1a9d8c1d4c197333e0d0 (patch)
tree4f69e727c624eafc5c1a812e24cc27b71175d69f /c++/src/H5LaccProp.cpp
parent56e5b4ed05fb3bad51c226ec5b567871a45e0bce (diff)
downloadhdf5-a48c9c4024e7ede0021e1a9d8c1d4c197333e0d0.zip
hdf5-a48c9c4024e7ede0021e1a9d8c1d4c197333e0d0.tar.gz
hdf5-a48c9c4024e7ede0021e1a9d8c1d4c197333e0d0.tar.bz2
Purpose: Add new C++ wrappers
Description: Added wrappers for H5Iis_valid, H5Ps/get_nlinks, H5Tget_create_plist, H5Oopen, H5Oclose and H5Pset_virtual // Checks if the given ID is valid. static bool isValid(hid_t an_id); // Sets the number of soft or user-defined links that can be // traversed before a failure occurs. void setNumLinks(size_t nlinks) const; // Gets the number of soft or user-defined link traversals allowed size_t getNumLinks() const; // Returns a copy of the creation property list of a datatype. PropList getCreatePlist() const; // Opens an object within a group or a file, i.e., root group. hid_t getObjId(const char* name,...); hid_t getObjId(const H5std_string& name,...); // Closes an object opened by getObjId(). void closeObjId(hid_t obj_id) const; // Maps elements of a virtual dataset to elements of the source dataset. void setVirtual(const DataSpace& vspace, const char *src_fname,...); void setVirtual(const DataSpace& vspace, const H5std_string src_fname,...); Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
Diffstat (limited to 'c++/src/H5LaccProp.cpp')
-rw-r--r--c++/src/H5LaccProp.cpp49
1 files changed, 43 insertions, 6 deletions
diff --git a/c++/src/H5LaccProp.cpp b/c++/src/H5LaccProp.cpp
index e9adb12..e457e83 100644
--- a/c++/src/H5LaccProp.cpp
+++ b/c++/src/H5LaccProp.cpp
@@ -40,7 +40,7 @@ LinkAccPropList* LinkAccPropList::DEFAULT_ = 0;
// If LinkAccPropList::DEFAULT_ already points to an allocated
// object, throw a PropListIException. This scenario should not
// happen.
-// Programmer Binh-Minh Ribler - 2015
+// Programmer Binh-Minh Ribler - December, 2016
//--------------------------------------------------------------------------
LinkAccPropList* LinkAccPropList::getConstant()
{
@@ -66,7 +66,7 @@ LinkAccPropList* LinkAccPropList::getConstant()
// Purpose: Deletes the constant object that LinkAccPropList::DEFAULT_
// points to.
// exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2015
+// Programmer Binh-Minh Ribler - December, 2016
//--------------------------------------------------------------------------
void LinkAccPropList::deleteConstants()
{
@@ -84,7 +84,7 @@ const LinkAccPropList& LinkAccPropList::DEFAULT = *getConstant();
//--------------------------------------------------------------------------
// Function: Default Constructor
///\brief Creates a file access property list
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - December, 2016
//--------------------------------------------------------------------------
LinkAccPropList::LinkAccPropList() : PropList(H5P_LINK_ACCESS) {}
@@ -92,7 +92,7 @@ LinkAccPropList::LinkAccPropList() : PropList(H5P_LINK_ACCESS) {}
// Function: LinkAccPropList copy constructor
///\brief Copy Constructor: makes a copy of the original
///\param original - IN: LinkAccPropList instance to copy
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - December, 2016
//--------------------------------------------------------------------------
LinkAccPropList::LinkAccPropList(const LinkAccPropList& original) : PropList(original) {}
@@ -100,14 +100,51 @@ LinkAccPropList::LinkAccPropList(const LinkAccPropList& original) : PropList(ori
// Function: LinkAccPropList overloaded constructor
///\brief Creates a file access property list using the id of an
/// existing one.
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - December, 2016
//--------------------------------------------------------------------------
LinkAccPropList::LinkAccPropList(const hid_t plist_id) : PropList(plist_id) {}
//--------------------------------------------------------------------------
+// Function: LinkAccPropList::setNumLinks
+///\brief Set the number of soft or user-defined link traversals allowed
+/// before the library assumes it has found a cycle and aborts the
+/// traversal.
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - March 1, 2017
+//--------------------------------------------------------------------------
+void LinkAccPropList::setNumLinks(size_t nlinks) const
+{
+ herr_t ret_value = H5Pset_nlinks(id, nlinks);
+ // Throw exception if H5Pset_nlinks returns failure
+ if (ret_value < 0)
+ {
+ throw PropListIException("setNumLinks", "H5Pset_nlinks failed");
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: LinkAccPropList::getNumLinks
+///\brief Gets the number of soft or user-defined links that can be
+/// traversed before a failure occurs.
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - March 1, 2017
+//--------------------------------------------------------------------------
+size_t LinkAccPropList::getNumLinks() const
+{
+ size_t nlinks = 0;
+ herr_t ret_value = H5Pget_nlinks(id, &nlinks);
+ // Throw exception if H5Pget_nlinks returns failure
+ if (ret_value < 0)
+ {
+ throw PropListIException("getNumLinks", "H5Pget_nlinks failed");
+ }
+ return(nlinks);
+}
+
+//--------------------------------------------------------------------------
// Function: LinkAccPropList destructor
///\brief Noop destructor
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - December, 2016
//--------------------------------------------------------------------------
LinkAccPropList::~LinkAccPropList() {}