HDF5 C++ API Reference Manual

 

 

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

Generated on Tue May 10 09:27:56 2011 by  doxygen 1.4.7