HDF5 C++ API Reference Manual

 

 

 

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

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