summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Attribute.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2016-08-22 06:29:29 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2016-08-22 06:29:29 (GMT)
commitb1c4fd77d9c4507d723016f464e6aed61dfc9307 (patch)
tree47ca174cba673f69f03a5c92654a86f7fa7be539 /c++/src/H5Attribute.cpp
parentae18cf66d8b1da0d728f55db50142665c152e26d (diff)
downloadhdf5-b1c4fd77d9c4507d723016f464e6aed61dfc9307.zip
hdf5-b1c4fd77d9c4507d723016f464e6aed61dfc9307.tar.gz
hdf5-b1c4fd77d9c4507d723016f464e6aed61dfc9307.tar.bz2
[svn-r30311] Purpose: Fix bug HDFFR-9920 cont.
trunk: Description: Continued rearranging the classes to model the relationship of HDF5 objects more accurately. The changes included: - in the baseclass list of Attribute, changed "public IdComponent" to "public H5Location", because location sometime can be specified with attribute - moved H5A wrappers in H5Location to H5Object because H5A functions can't be called on attribute id - removed the stubs Attribute::iterateAttrs and Attribute::renameAttr - removed Attribute::getFileName and Attribute::flush, because H5Location has them - result of the modified partial class diagram, regarding Attribute IdComponent | H5Location AbstractDs / \ / H5Object Attribute Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
Diffstat (limited to 'c++/src/H5Attribute.cpp')
-rw-r--r--c++/src/H5Attribute.cpp55
1 files changed, 9 insertions, 46 deletions
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp
index f07f34b..5454583 100644
--- a/c++/src/H5Attribute.cpp
+++ b/c++/src/H5Attribute.cpp
@@ -24,13 +24,13 @@
#include "H5Exception.h"
#include "H5IdComponent.h"
#include "H5PropList.h"
+#include "H5Location.h"
#include "H5Object.h"
#include "H5AbstractDs.h"
#include "H5FaccProp.h"
#include "H5FcreatProp.h"
#include "H5OcreatProp.h"
#include "H5DcreatProp.h"
-//#include "H5CommonFG.h"
#include "H5DataType.h"
#include "H5DataSpace.h"
#include "H5Group.h"
@@ -53,7 +53,7 @@ class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate
///\brief Default constructor: Creates a stub attribute
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
-Attribute::Attribute() : AbstractDs(), IdComponent(), id(H5I_INVALID_HID) {}
+Attribute::Attribute() : AbstractDs(), H5Location(), id(H5I_INVALID_HID) {}
//--------------------------------------------------------------------------
// Function: Attribute copy constructor
@@ -61,7 +61,7 @@ Attribute::Attribute() : AbstractDs(), IdComponent(), id(H5I_INVALID_HID) {}
///\param original - IN: Original Attribute object to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Attribute::Attribute(const Attribute& original) : AbstractDs(), IdComponent(), id(original.id)
+Attribute::Attribute(const Attribute& original) : AbstractDs(), H5Location(), id(original.id)
{
incRefCount(); // increment number of references to this id
}
@@ -74,7 +74,7 @@ Attribute::Attribute(const Attribute& original) : AbstractDs(), IdComponent(), i
///\exception H5::AttributeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Attribute::Attribute(const hid_t existing_id) : AbstractDs(), IdComponent(), id(existing_id)
+Attribute::Attribute(const hid_t existing_id) : AbstractDs(), H5Location(), id(existing_id)
{
incRefCount(); // increment number of references to this id
}
@@ -283,23 +283,6 @@ DataSpace Attribute::getSpace() const
}
//--------------------------------------------------------------------------
-// Function: Attribute::getFileName
-///\brief Gets the name of the file, in which this attribute belongs.
-///\return File name
-///\exception H5::IdComponentException
-// Programmer Binh-Minh Ribler - Jul, 2004
-//--------------------------------------------------------------------------
-H5std_string Attribute::getFileName() const
-{
- try {
- return(p_get_file_name());
- }
- catch (IdComponentException& E) {
- throw FileIException("Attribute::getFileName", E.getDetailMsg());
- }
-}
-
-//--------------------------------------------------------------------------
// Function: Attribute::getName
///\brief Gets the name of this attribute, returning its length.
///\param attr_name - OUT: Buffer for the name string as char*
@@ -487,31 +470,6 @@ hsize_t Attribute::getStorageSize() const
}
//--------------------------------------------------------------------------
-// Function: Attribute::flush
-///\brief Flushes all buffers associated with a file specified by
-/// this attribute, to disk.
-///\param scope - IN: Specifies the scope of the flushing action,
-/// which can be either of these values:
-/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file
-/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file
-///\exception H5::AttributeIException
-///\par Description
-/// This attribute is used to identify the file to be flushed.
-// Programmer Binh-Minh Ribler - 2012
-// Modification
-// Sep 2012 - BMR
-// Duplicated from H5Location
-//--------------------------------------------------------------------------
-void Attribute::flush(H5F_scope_t scope) const
-{
- herr_t ret_value = H5Fflush(getId(), scope);
- if( ret_value < 0 )
- {
- throw AttributeIException("Attribute::flush", "H5Fflush failed");
- }
-}
-
-//--------------------------------------------------------------------------
// Function: Attribute::getId
///\brief Get the id of this attribute
///\return Attribute identifier
@@ -521,6 +479,11 @@ void Attribute::flush(H5F_scope_t scope) const
// addition, member IdComponent::id is moved into subclasses, and
// IdComponent::getId now becomes pure virtual function.
// Programmer Binh-Minh Ribler - May, 2008
+// Modification
+// Aug 2016 - BMR
+// Note that Attribute is now inheriting from H5Location, because
+// an attribute id can be used to specify a location in HDF5
+// library.
//--------------------------------------------------------------------------
hid_t Attribute::getId() const
{