HDF5 C++ API Reference Manual

 

 

 

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

H5File.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 _H5File_H
00017 #define _H5File_H
00018 
00019 #ifndef H5_NO_NAMESPACE
00020 namespace H5 {
00021 #endif
00022 
00023 class H5_DLLCPP H5File : public IdComponent, public CommonFG {
00024    public:
00025         // Creates or opens an HDF5 file.
00026         H5File( const char* name, unsigned int flags,
00027            const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT,
00028            const FileAccPropList& access_plist = FileAccPropList::DEFAULT );
00029         H5File( const string& name, unsigned int flags,
00030            const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT,
00031            const FileAccPropList& access_plist = FileAccPropList::DEFAULT );
00032 
00033         // Close this file.
00034         virtual void close();
00035 
00036         // Gets the access property list of this file.
00037         FileAccPropList getAccessPlist() const;
00038 
00039         // Gets the creation property list of this file.
00040         FileCreatPropList getCreatePlist() const;
00041 
00042         // Gets the name of this file.
00043         string getFileName() const;
00044 
00045         // Retrieves the file size of an opened file.
00046         hsize_t getFileSize() const;
00047 
00048         // Returns the amount of free space in the file.
00049         hssize_t getFreeSpace() const;
00050 
00051         // Returns the number of opened object IDs (files, datasets, groups
00052         // and datatypes) in the same file.
00053         int getObjCount(unsigned types) const;
00054         int getObjCount() const;
00055 
00056         // Retrieves a list of opened object IDs (files, datasets, groups
00057         // and datatypes) in the same file.
00058         void getObjIDs(unsigned types, int max_objs, hid_t *oid_list) const;
00059 
00060         // Retrieves the type of object that an object reference points to.
00061         H5G_obj_t getObjType(void *ref, H5R_type_t ref_type) const;
00062 
00063         // Retrieves a dataspace with the region pointed to selected.
00064         DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
00065 
00066         // Returns the pointer to the file handle of the low-level file driver.
00067         void getVFDHandle(FileAccPropList& fapl, void **file_handle) const;
00068         void getVFDHandle(void **file_handle) const;
00069 
00070         // Determines if a file, specified by its name, is in HDF5 format
00071         static bool isHdf5(const char* name );
00072         static bool isHdf5(const string& name );
00073 
00074         // Reopens this file.
00075         void reOpen();  // added for better name
00076         void reopen();
00077 
00078         // Creates a reference to a named Hdf5 object or to a dataset region
00079         // in this object.
00080         void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const;
00081 
00082         // Creates a reference to a named Hdf5 object in this object.
00083         void* Reference(const char* name) const;
00084         void* Reference(const string& name) const;
00085 
00087         virtual string fromClass () const { return ("H5File"); }
00088 
00089         // Throw file exception.
00090         virtual void throwException(const string func_name, const string msg) const;
00091 
00092         // Gets the file id
00093         virtual hid_t getLocId() const;
00094 
00095         // Default constructor
00096         H5File();
00097 
00098         // Copy constructor: makes a copy of the original H5File object.
00099         H5File(const H5File& original);
00100 
00101         // H5File destructor.
00102         virtual ~H5File();
00103 
00104    private:
00105         // This function is private and contains common code between the
00106         // constructors taking a string or a char*
00107         void p_get_file( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist );
00108 
00109 };
00110 #ifndef H5_NO_NAMESPACE
00111 }
00112 #endif
00113 #endif

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