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         // Sets the identifier of this object to a new value.
00045         void setId( hid_t new_id );
00046 
00047         // Creates an object to hold an HDF5 identifier.
00048         IdComponent( const hid_t h5_id );
00049 
00050         // Copy constructor: makes copy of the original IdComponent object.
00051         IdComponent( const IdComponent& original );
00052 
00053         // Gets the value of IdComponent's data member.
00054         virtual hid_t getId () const;
00055 
00056 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00057         // Pure virtual function for there are various H5*close for the
00058         // subclasses.
00059         virtual void close() = 0;
00060 #endif // DOXYGEN_SHOULD_SKIP_THIS
00061 
00062         // Destructor
00063         virtual ~IdComponent();
00064 
00065    protected:
00066 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00067         hid_t id;       // HDF5 object id
00068 
00069         // Default constructor.
00070         IdComponent();
00071 
00072         // Gets the name of the file, in which an HDF5 object belongs.
00073 #ifndef H5_NO_STD
00074         std::string p_get_file_name() const;
00075 #else
00076         string p_get_file_name() const;
00077 #endif  // H5_NO_STD
00078 
00079         // Gets the id of the H5 file in which the given object is located.
00080         hid_t p_get_file_id();
00081 
00082         // Creates a reference to an HDF5 object or a dataset region.
00083         void* p_reference(const char* name, hid_t space_id, H5R_type_t ref_type) const;
00084 
00085         // Retrieves the type of object that an object reference points to.
00086         H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const;
00087 
00088         // Retrieves a dataspace with the region pointed to selected.
00089         hid_t p_get_region(void *ref, H5R_type_t ref_type) const;
00090 #endif // DOXYGEN_SHOULD_SKIP_THIS
00091 
00092 }; // end class IdComponent
00093 
00094 #ifndef H5_NO_NAMESPACE
00095 }
00096 #endif
00097 #endif

Generated on Sat Apr 23 16:19:45 2005 by  doxygen 1.4.2