HDF5 C++ API Reference Manual

 

 

Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File 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 represents an HDF5 object that has an identifier.
00020 
00021 #ifndef H5_NO_NAMESPACE
00022 namespace H5 {
00023 #endif
00024 
00025 class H5_DLLCPP IdComponent {
00026    public:
00027         // Increment reference counter.
00028         void incRefCount(const hid_t obj_id) const;
00029         void incRefCount() const;
00030 
00031         // Decrement reference counter.
00032         void decRefCount(const hid_t obj_id) const;
00033         void decRefCount() const;
00034 
00035         // Get the reference counter to this identifier.
00036         int getCounter(const hid_t obj_id) const;
00037         int getCounter() const;
00038 
00039         // Returns an HDF object type, given the object id.
00040         static H5I_type_t getHDFObjType(const hid_t obj_id);
00041 
00042         // Assignment operator.
00043         IdComponent& operator=( const IdComponent& rhs );
00044 
00045         // Sets the identifier of this object to a new value.
00046         void setId(const hid_t new_id);
00047 
00048         // Creates an object to hold an HDF5 identifier.
00049         IdComponent( const hid_t h5_id );
00050 
00051         // Copy constructor: makes copy of the original IdComponent object.
00052         IdComponent( const IdComponent& original );
00053 
00054         // Gets the value of IdComponent's data member.
00055         virtual hid_t getId () const;
00056 
00057 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00058         // Pure virtual function for there are various H5*close for the
00059         // subclasses.
00060         virtual void close() = 0;
00061 
00062         // Makes and returns the string "<class-name>::<func_name>";
00063         // <class-name> is returned by fromClass().
00064         H5std_string inMemFunc(const char* func_name) const;
00065 
00066         // Returns this class name.
00067         virtual H5std_string fromClass() const { return("IdComponent");}
00068 
00069 #endif // DOXYGEN_SHOULD_SKIP_THIS
00070 
00071         // Destructor
00072         virtual ~IdComponent();
00073 
00074    protected:
00075 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00076         hid_t id;       // HDF5 object id
00077 
00078         // Default constructor.
00079         IdComponent();
00080 
00081         // Gets the name of the file, in which an HDF5 object belongs.
00082         H5std_string p_get_file_name() const;
00083 
00084         // Gets the id of the H5 file in which the given object is located.
00085         hid_t p_get_file_id();
00086 
00087         // Creates a reference to an HDF5 object or a dataset region.
00088         void* p_reference(const char* name, hid_t space_id, H5R_type_t ref_type) const;
00089 
00090         // Retrieves the type of object that an object reference points to.
00091         H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const;
00092 
00093         // Retrieves a dataspace with the region pointed to selected.
00094         hid_t p_get_region(void *ref, H5R_type_t ref_type) const;
00095 
00096         // Verifies that the given id is valid.
00097         bool p_valid_id(const hid_t obj_id) const;
00098 
00099 #endif // DOXYGEN_SHOULD_SKIP_THIS
00100 
00101 }; // end class IdComponent
00102 
00103 #ifndef H5_NO_NAMESPACE
00104 }
00105 #endif
00106 #endif

Generated on Thu Apr 20 15:16:40 2006 by doxygen 1.3.2