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

Generated on Thu Aug 5 00:22:37 2004 by doxygen 1.3.7-20040718