HDF5 C++ API Reference Manual

 

 

 

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

H5CommonFG.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 // CommonFG is a protocol class.  Its existence is simply to provide the
00017 // common services that are provided by H5File and Group.  The file or
00018 // group in the context of this class is referred to as 'location'.
00019 
00020 #ifndef _CommonFG_H
00021 #define _CommonFG_H
00022 
00023 #ifndef H5_NO_NAMESPACE
00024 namespace H5 {
00025 #endif
00026 
00027 class Group;
00028 class H5File;
00029 class H5_DLLCPP CommonFG {
00030    public:
00031         // Creates a new group at this location which can be a file 
00032         // or another group.
00033         Group createGroup(const char* name, size_t size_hint = 0) const;
00034         Group createGroup(const string& name, size_t size_hint = 0) const;
00035 
00036         // Opens an existing group in a location which can be a file 
00037         // or another group.
00038         Group openGroup(const char* name) const;
00039         Group openGroup(const string& name) const;
00040 
00041         // Creates a new dataset at this location.
00042         DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const;
00043         DataSet createDataSet(const string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const;
00044 
00045         // Opens an existing dataset at this location.
00046         DataSet openDataSet(const char* name) const;
00047         DataSet openDataSet(const string& name) const;
00048 
00049         // Retrieves comment for the HDF5 object specified by its name.
00050         string getComment(const char* name, size_t bufsize) const;
00051         string getComment(const string& name, size_t bufsize) const;
00052 
00053         // Sets the comment for an HDF5 object specified by its name.
00054         void setComment(const char* name, const char* comment) const;
00055         void setComment(const string& name, const string& comment) const;
00056 
00057         // Returns the name of the HDF5 object that the symbolic link points to.
00058         string getLinkval(const char* name, size_t size) const;
00059         string getLinkval(const string& name, size_t size) const;
00060 
00061         // Returns the number of objects in this group.
00062         hsize_t getNumObjs() const;
00063 
00064         // Returns information about an HDF5 object, given by its name, 
00065         // at this location.
00066         void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const;
00067         void getObjinfo(const string& name, hbool_t follow_link, H5G_stat_t& statbuf) const;
00068 
00069         // Retrieves the name of an object in this group, given the
00070         // object's index.
00071         ssize_t getObjnameByIdx(hsize_t idx, string& name, size_t size) const;
00072         string getObjnameByIdx(hsize_t idx) const;
00073 
00074         // Returns the type of an object in this group, given the
00075         // object's index.
00076         H5G_obj_t getObjTypeByIdx(hsize_t idx) const;
00077         H5G_obj_t getObjTypeByIdx(hsize_t idx, string& type_name) const;
00078 
00079         // Iterates over the elements of this group - not implemented in
00080         // C++ style yet.
00081         int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data);
00082         int iterateElems(const string& name, int *idx, H5G_iterate_t op, void *op_data);
00083 
00084         // Creates a link of the specified type from new_name to current_name;
00085         // both names are interpreted relative to the specified location id.
00086         void link(H5G_link_t link_type, const char* curr_name, const char* new_name) const;
00087         void link(H5G_link_t link_type, const string& curr_name, const string& new_name) const;
00088 
00089         // Removes the specified name at this location.
00090         void unlink(const char* name) const;
00091         void unlink(const string& name) const;
00092 
00093         // Mounts the file 'child' onto this location.
00094         void mount(const char* name, H5File& child, PropList& plist) const;
00095         void mount(const string& name, H5File& child, PropList& plist) const;
00096 
00097         // Unmounts the file named 'name' from this parent location.
00098         void unmount(const char* name) const;
00099         void unmount(const string& name) const;
00100 
00101         // Renames an object at this location.
00102         void move(const char* src, const char* dst) const;
00103         void move(const string& src, const string& dst) const;
00104 
00105         // Opens a generic named datatype in this location.
00106         DataType openDataType(const char* name) const;
00107         DataType openDataType(const string& name) const;
00108 
00109         // Opens a named enumeration datatype in this location.
00110         EnumType openEnumType(const char* name) const;
00111         EnumType openEnumType(const string& name) const;
00112 
00113         // Opens a named compound datatype in this location.
00114         CompType openCompType(const char* name) const;
00115         CompType openCompType(const string& name) const;
00116 
00117         // Opens a named integer datatype in this location.
00118         IntType openIntType(const char* name) const;
00119         IntType openIntType(const string& name) const;
00120 
00121         // Opens a named floating-point datatype in this location.
00122         FloatType openFloatType(const char* name) const;
00123         FloatType openFloatType(const string& name) const;
00124 
00125         // Opens a named string datatype in this location.
00126         StrType openStrType(const char* name) const;
00127         StrType openStrType(const string& name) const;
00128 
00131         virtual hid_t getLocId() const = 0; 
00132 
00134         virtual void throwException(const string func_name, const string msg) const = 0;
00135 
00136         // Default constructor.
00137         CommonFG();
00138 
00139         // Noop destructor.
00140         virtual ~CommonFG();
00141 
00142    private:
00143         // Common code for member functions openXxxType 
00144         hid_t p_open_data_type(const char* name) const;
00145 
00146 }; // end of CommonFG declaration
00147 
00148 #ifndef H5_NO_NAMESPACE
00149 }
00150 #endif
00151 #endif
00152 

Generated on Sat Apr 23 16:19:44 2005 by  doxygen 1.4.2