00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
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         
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         
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         
00041         virtual void close();
00042 
00043         
00044         void flush(H5F_scope_t scope) const;
00045 
00046         
00047         FileAccPropList getAccessPlist() const;
00048 
00049         
00050         FileCreatPropList getCreatePlist() const;
00051 
00052         
00053         H5std_string getFileName() const;
00054 
00055         
00056         hsize_t getFileSize() const;
00057 
00058         
00059         hssize_t getFreeSpace() const;
00060 
00061         
00062         
00063         ssize_t getObjCount(unsigned types) const;
00064         ssize_t getObjCount() const;
00065 
00066         
00067         
00068         void getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const;
00069 
00070 #ifndef H5_NO_DEPRECATED_SYMBOLS
00071         
00072         H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
00073 #endif 
00074 
00075         
00076         DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
00077 
00078         
00079         void getVFDHandle(FileAccPropList& fapl, void **file_handle) const;
00080         void getVFDHandle(void **file_handle) const;
00081 
00082         
00083         static bool isHdf5(const char* name );
00084         static bool isHdf5(const H5std_string& name );
00085 
00086         
00087         void reOpen();  
00088         void reopen();
00089 
00090         
00091         
00092         void reference(void* ref, const char* name, const DataSpace& dataspace,
00093                         H5R_type_t ref_type = H5R_DATASET_REGION) const;
00094         void reference(void* ref, const char* name) const;
00095         void reference(void* ref, const H5std_string& name) const;
00096 
00098         virtual H5std_string fromClass () const { return("H5File"); }
00099 
00100         
00101         virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const;
00102 
00103         
00104         virtual hid_t getLocId() const;
00105 
00106         
00107         H5File();
00108 
00109         
00110         H5File(const H5File& original);
00111 
00112         
00113         virtual hid_t getId() const;
00114 
00115         
00116         virtual ~H5File();
00117 
00118    private:
00119         hid_t id;       
00120 
00121 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00122 
00123         
00124         
00125         void p_get_file( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist );
00126 
00127         
00128         void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const;
00129 
00130 #ifndef H5_NO_DEPRECATED_SYMBOLS
00131         
00132         H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const;
00133 #endif 
00134 
00135         
00136         hid_t p_get_region(void *ref, H5R_type_t ref_type) const;
00137 
00138    protected:
00139         
00140         virtual void p_setId(const hid_t new_id);
00141 
00142 #endif // DOXYGEN_SHOULD_SKIP_THIS
00143 
00144 };
00145 #ifndef H5_NO_NAMESPACE
00146 }
00147 #endif
00148 #endif