summaryrefslogtreecommitdiffstats
path: root/hl/c++/src
diff options
context:
space:
mode:
Diffstat (limited to 'hl/c++/src')
-rw-r--r--hl/c++/src/H5PacketTable.cpp15
-rw-r--r--hl/c++/src/H5PacketTable.h6
2 files changed, 21 insertions, 0 deletions
diff --git a/hl/c++/src/H5PacketTable.cpp b/hl/c++/src/H5PacketTable.cpp
index fabe490..6a16807 100644
--- a/hl/c++/src/H5PacketTable.cpp
+++ b/hl/c++/src/H5PacketTable.cpp
@@ -86,6 +86,21 @@
return H5PTset_index(table_id, index);
}
+ /* SetIndex
+ * Sets the index to point to the packet specified by index.
+ * Returns 0 on success, negative on failure (if index is out of bounds)
+ */
+ int PacketTable::GetIndex(int &error)
+ {
+ hsize_t index;
+
+ error = H5PTget_index(table_id, &index);
+ if(error < 0)
+ return 0;
+ else
+ return index;
+ }
+
/* GetPacketCount
* Returns the number of packets in the packet table. Error
* is set to 0 on success. On failure, returns 0 and
diff --git a/hl/c++/src/H5PacketTable.h b/hl/c++/src/H5PacketTable.h
index 3ce24c4..3ba4e5e 100644
--- a/hl/c++/src/H5PacketTable.h
+++ b/hl/c++/src/H5PacketTable.h
@@ -74,6 +74,12 @@ public:
*/
int SetIndex(unsigned int index);
+ /* GetIndex
+ * Returns the position of the current packet.
+ * On failure, returns 0 and error is set to negative.
+ */
+ int GetIndex(int& error);
+
/* GetPacketCount
* Returns the number of packets in the packet table. Error
* is set to 0 on success. On failure, returns 0 and