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 [email protected]. *
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 #ifndef H5_NO_STD
00025     using std::string;
00026 #endif  // H5_NO_STD
00027 #endif
00028 
00029 class H5_DLLCPP IdComponent {
00030    public:
00031         // Increment reference counter.
00032         void incRefCount(hid_t obj_id) const;
00033         void incRefCount() const;
00034 
00035         // Decrement reference counter.
00036         void decRefCount(hid_t obj_id) const;
00037         void decRefCount() const;
00038 
00039         // Get the reference counter to this identifier.
00040         int getCounter(hid_t obj_id) const;
00041         int getCounter() const;
00042 
00043         // Assignment operator
00044         IdComponent& operator=( const IdComponent& rhs );
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 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00059         // Pure virtual function for there are various H5*close for the
00060         // subclasses.
00061         virtual void close() = 0;
00062 
00063 #endif // DOXYGEN_SHOULD_SKIP_THIS
00064 
00065         // Makes and returns the string "<class-name>::<func_name>";
00066         // <class-name> is returned by fromClass().
00067         string inMemFunc(const char* func_name) const;
00068 
00069         // Returns this class name.
00070         virtual string fromClass() const {return ("IdComponent");}
00071 
00072         // Destructor
00073         virtual ~IdComponent();
00074 
00075    protected:
00076 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00077         hid_t id;       // HDF5 object id
00078 
00079         // Default constructor.
00080         IdComponent();
00081 
00082         // Gets the name of the file, in which an HDF5 object belongs.
00083 #ifndef H5_NO_STD
00084         std::string p_get_file_name() const;
00085 #else
00086         string p_get_file_name() const;
00087 #endif  // H5_NO_STD
00088 
00089         // Gets the id of the H5 file in which the given object is located.
00090         hid_t p_get_file_id();
00091 
00092         // Creates a reference to an HDF5 object or a dataset region.
00093         void* p_reference(const char* name, hid_t space_id, H5R_type_t ref_type) const;
00094 
00095         // Retrieves the type of object that an object reference points to.
00096         H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const;
00097 
00098         // Retrieves a dataspace with the region pointed to selected.
00099         hid_t p_get_region(void *ref, H5R_type_t ref_type) const;
00100 
00101         // Verifies that the given id is valid.
00102         bool p_valid_id(hid_t obj_id) const;
00103 
00104 #endif // DOXYGEN_SHOULD_SKIP_THIS
00105 
00106 }; // end class IdComponent
00107 
00108 #ifndef H5_NO_NAMESPACE
00109 }
00110 #endif
00111 #endif

Generated on Mon Oct 31 04:59:47 2005 by  doxygen 1.4.2