HDF5 C++ API Reference Manual

 

 

 

Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Examples

H5IdComponent.h

Go to the documentation of this file.
00001 // C++ informative line for the emacs editor: -*- C++ -*- 00002 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00003 * Copyright by the Board of Trustees of the University of Illinois. * 00004 * All rights reserved. * 00005 * * 00006 * This file is part of HDF5. The full HDF5 copyright notice, including * 00007 * terms governing use, modification, and redistribution, is contained in * 00008 * the files COPYING and Copyright.html. COPYING can be found at the root * 00009 * of the source code distribution tree; Copyright.html can be found at the * 00010 * root level of an installed copy of the electronic HDF5 document set and * 00011 * is linked from the top-level documents page. It can also be found at * 00012 * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * 00013 * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * 00014 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 00015 00016 #ifndef _IdComponent_H 00017 #define _IdComponent_H 00018 00019 // IdComponent provides a mechanism to handle 00020 // reference counting for an identifier of any HDF5 object. 00021 00022 #ifndef H5_NO_NAMESPACE 00023 namespace H5 { 00024 #endif 00025 00026 class H5_DLLCPP IdComponent { 00027 public: 00028 // Increment reference counter 00029 void incRefCount(); 00030 00031 // Decrement reference counter 00032 void decRefCount(); 00033 00034 // Get the reference counter to this identifier 00035 int getCounter(); 00036 00037 // Decrements the reference counter then determines if there are no more 00038 // reference to this object 00039 bool noReference(); 00040 00041 // Assignment operator 00042 IdComponent& operator=( const IdComponent& rhs ); 00043 00044 void reset(); 00045 00046 // Sets the identifier of this object to a new value. 00047 void setId( hid_t new_id ); 00048 00049 // Creates an object to hold an HDF5 identifier 00050 IdComponent( const hid_t h5_id ); 00051 00052 // Copy constructor: makes copy of the original IdComponent object. 00053 IdComponent( const IdComponent& original ); 00054 00055 // Gets the value of IdComponent's data member 00056 virtual hid_t getId () const; 00057 00058 // Pure virtual function so appropriate close function can 00059 // be called by subclasses' for the corresponding object 00060 // This function will be obsolete because its functionality 00061 // is recently handled by the C library layer. 00062 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00063 virtual void p_close() const = 0; 00064 #endif // DOXYGEN_SHOULD_SKIP_THIS 00065 00066 // Destructor 00067 virtual ~IdComponent(); 00068 00069 protected: 00070 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00071 hid_t id; // HDF5 object id 00072 RefCounter* ref_count; // used to keep track of the 00073 // number of copies of an object 00074 00075 // Default constructor. 00076 IdComponent(); 00077 00078 // Gets the name of the file, in which an HDF5 object belongs. 00079 #ifndef H5_NO_STD 00080 std::string p_get_file_name() const; 00081 #else 00082 string p_get_file_name() const; 00083 #endif // H5_NO_STD 00084 00085 // Gets the id of the H5 file in which the given object is located. 00086 hid_t p_get_file_id(); 00087 00088 // Creates a reference to an HDF5 object or a dataset region. 00089 void* p_reference(const char* name, hid_t space_id, H5R_type_t ref_type) const; 00090 00091 // Retrieves the type of object that an object reference points to. 00092 H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const; 00093 00094 // Retrieves a dataspace with the region pointed to selected. 00095 hid_t p_get_region(void *ref, H5R_type_t ref_type) const; 00096 #endif // DOXYGEN_SHOULD_SKIP_THIS 00097 00098 }; // end class IdComponent 00099 00100 #ifndef H5_NO_NAMESPACE 00101 } 00102 #endif 00103 #endif

Generated on Thu Aug 5 00:22:37 2004 by doxygen 1.3.7-20040718