diff options
author | James Laird <jlaird@hdfgroup.org> | 2006-08-14 16:18:28 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2006-08-14 16:18:28 (GMT) |
commit | 0f61afce1cc9286e0da761d60f0c0db51423db32 (patch) | |
tree | 04c46c8276655eefa07cf8bc674c31d5df86d104 /hl/c++/src | |
parent | 89f36d62b776ef955eed82a109b83a187ef115bb (diff) | |
download | hdf5-0f61afce1cc9286e0da761d60f0c0db51423db32.zip hdf5-0f61afce1cc9286e0da761d60f0c0db51423db32.tar.gz hdf5-0f61afce1cc9286e0da761d60f0c0db51423db32.tar.bz2 |
[svn-r12576] Added funtions to query the "current position" for Packet Tables in C and C++.
Diffstat (limited to 'hl/c++/src')
-rw-r--r-- | hl/c++/src/H5PacketTable.cpp | 15 | ||||
-rw-r--r-- | hl/c++/src/H5PacketTable.h | 6 |
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 |