HDF5 C++ API Reference Manual

 

 

 

Main Page | Namespace List | Class Hierarchy | Class List | File List | Class 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 HDF Group.                                               *
00004  * Copyright by the Board of Trustees of the University of Illinois.         *
00005  * All rights reserved.                                                      *
00006  *                                                                           *
00007  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00008  * terms governing use, modification, and redistribution, is contained in    *
00009  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00010  * of the source code distribution tree; Copyright.html can be found at the  *
00011  * root level of an installed copy of the electronic HDF5 document set and   *
00012  * is linked from the top-level documents page.  It can also be found at     *
00013  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00014  * access to either file, you may request a copy from help@hdfgroup.org.     *
00015  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00016 
00017 #ifndef _IdComponent_H
00018 #define _IdComponent_H
00019 
00020 // IdComponent represents an HDF5 object that has an identifier.
00021 
00022 #ifndef H5_NO_NAMESPACE
00023 namespace H5 {
00024 #endif
00025 
00026 class DataSpace;
00027 class H5_DLLCPP IdComponent {
00028    public:
00029         // Increment reference counter.
00030         void incRefCount(const hid_t obj_id) const;
00031         void incRefCount() const;
00032 
00033         // Decrement reference counter.
00034         void decRefCount(const hid_t obj_id) const;
00035         void decRefCount() const;
00036 
00037         // Get the reference counter to this identifier.
00038         int getCounter(const hid_t obj_id) const;
00039         int getCounter() const;
00040 
00041         // Returns an HDF5 object type, given the object id.
00042         static H5I_type_t getHDFObjType(const hid_t obj_id);
00043 
00044         // Assignment operator.
00045         IdComponent& operator=( const IdComponent& rhs );
00046 
00047         void reference(void* ref, const char* name, const DataSpace& dataspace,
00048                         H5R_type_t ref_type = H5R_DATASET_REGION) const;
00049         void reference(void* ref, const char* name) const;
00050         void reference(void* ref, const H5std_string& name) const;
00051 
00052         // Open a referenced HDF5 object.
00053         void dereference(IdComponent& obj, void* ref);
00054 
00055         // Sets the identifier of this object to a new value.
00056         void setId(const hid_t new_id);
00057 
00058         // Creates an object to hold an HDF5 identifier.
00059         IdComponent( const hid_t h5_id );
00060 
00061         // Copy constructor: makes copy of the original IdComponent object.
00062         IdComponent( const IdComponent& original );
00063 
00064         // Gets the value of IdComponent's data member.
00065         virtual hid_t getId () const;
00066 
00067 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00068         // Pure virtual function for there are various H5*close for the
00069         // subclasses.
00070         virtual void close() = 0;
00071 
00072         // Makes and returns the string "<class-name>::<func_name>";
00073         // <class-name> is returned by fromClass().
00074         H5std_string inMemFunc(const char* func_name) const;
00075 
00076         // Returns this class name.
00077         virtual H5std_string fromClass() const { return("IdComponent");}
00078 
00079 #endif // DOXYGEN_SHOULD_SKIP_THIS
00080 
00081         // Destructor
00082         virtual ~IdComponent();
00083 
00084    protected:
00085 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00086         hid_t id;       // HDF5 object id
00087 
00088         // Default constructor.
00089         IdComponent();
00090 
00091         // Gets the name of the file, in which an HDF5 object belongs.
00092         H5std_string p_get_file_name() const;
00093 
00094         // Gets the id of the H5 file in which the given object is located.
00095         hid_t p_get_file_id();
00096 
00097         // Creates a reference to an HDF5 object or a dataset region.
00098         void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const;
00099         void* p_reference(const char* name, hid_t space_id, H5R_type_t ref_type) const; // will be removed
00100 
00101         // Retrieves the type of object that an object reference points to.
00102         H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const;
00103 
00104         // Retrieves a dataspace with the region pointed to selected.
00105         hid_t p_get_region(void *ref, H5R_type_t ref_type) const;
00106 
00107         // Verifies that the given id is valid.
00108         bool p_valid_id(const hid_t obj_id) const;
00109 
00110 #endif // DOXYGEN_SHOULD_SKIP_THIS
00111 
00112 }; // end class IdComponent
00113 
00114 #ifndef H5_NO_NAMESPACE
00115 }
00116 #endif
00117 #endif

Generated on Tue Aug 14 13:56:59 2007 by  doxygen 1.3.9.1