HDF5 C++ API Reference Manual

 

 

Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File 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 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 // 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 H5std_string& name) const;
00054         H5std_string getComment(const char* name, size_t bufsize) const;
00055         H5std_string getComment(const H5std_string& name, size_t bufsize) const;
00056 
00057         // Removes the comment for the HDF5 object specified by its name.
00058         void removeComment(const char* name) const;
00059         void removeComment(const H5std_string& name) const;
00060 
00061         // Sets the comment for an HDF5 object specified by its name.
00062         void setComment(const char* name, const char* comment) const;
00063         void setComment(const H5std_string& name, const H5std_string& comment) const;
00064 
00065         // Returns the name of the HDF5 object that the symbolic link points to.
00066         H5std_string getLinkval(const char* name, size_t size) const;
00067         H5std_string getLinkval(const H5std_string& name, size_t size) const;
00068 
00069         // Returns the number of objects in this group.
00070         hsize_t getNumObjs() const;
00071 
00072         // Retrieves the name of an object in this group, given the
00073         // object's index.
00074         ssize_t getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const;
00075         H5std_string getObjnameByIdx(hsize_t idx) 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, H5std_string& type_name) const;
00082 
00083         // Returns information about an HDF5 object, given by its name,
00084         // at this location.
00085         void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const;
00086         void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const;
00087         void getObjinfo(const char* name, H5G_stat_t& statbuf) const;
00088         void getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const;
00089 
00090         // Iterates over the elements of this group - not implemented in
00091         // C++ style yet.
00092         int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data);
00093         int iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op, void *op_data);
00094 #endif /* H5_NO_DEPRECATED_SYMBOLS */
00095 
00096         // Creates a link of the specified type from new_name to current_name;
00097         // both names are interpreted relative to the specified location id.
00098         void link(H5L_type_t link_type, const char* curr_name, const char* new_name) const;
00099         void link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const;
00100 
00101         // Removes the specified name at this location.
00102         void unlink(const char* name) const;
00103         void unlink(const H5std_string& name) const;
00104 
00105         // Mounts the file 'child' onto this location.
00106         void mount(const char* name, H5File& child, PropList& plist) const;
00107         void mount(const H5std_string& name, H5File& child, PropList& plist) const;
00108 
00109         // Unmounts the file named 'name' from this parent location.
00110         void unmount(const char* name) const;
00111         void unmount(const H5std_string& name) const;
00112 
00113         // Renames an object at this location.
00114         void move(const char* src, const char* dst) const;
00115         void move(const H5std_string& src, const H5std_string& dst) const;
00116 
00117         // Opens a generic named datatype in this location.
00118         DataType openDataType(const char* name) const;
00119         DataType openDataType(const H5std_string& name) const;
00120 
00121         // Opens a named array datatype in this location.
00122         ArrayType openArrayType(const char* name) const;
00123         ArrayType openArrayType(const H5std_string& name) const;
00124 
00125         // Opens a named compound datatype in this location.
00126         CompType openCompType(const char* name) const;
00127         CompType openCompType(const H5std_string& name) const;
00128 
00129         // Opens a named enumeration datatype in this location.
00130         EnumType openEnumType(const char* name) const;
00131         EnumType openEnumType(const H5std_string& name) const;
00132 
00133         // Opens a named integer datatype in this location.
00134         IntType openIntType(const char* name) const;
00135         IntType openIntType(const H5std_string& name) const;
00136 
00137         // Opens a named floating-point datatype in this location.
00138         FloatType openFloatType(const char* name) const;
00139         FloatType openFloatType(const H5std_string& name) const;
00140 
00141         // Opens a named string datatype in this location.
00142         StrType openStrType(const char* name) const;
00143         StrType openStrType(const H5std_string& name) const;
00144 
00145         // Opens a named variable length datatype in this location.
00146         VarLenType openVarLenType(const char* name) const;
00147         VarLenType openVarLenType(const H5std_string& name) const;
00148 
00149 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00152         virtual hid_t getLocId() const = 0;
00153 
00154 #endif // DOXYGEN_SHOULD_SKIP_THIS
00155 
00157         virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const = 0;
00158 
00159         // Default constructor.
00160         CommonFG();
00161 
00162         // Noop destructor.
00163         virtual ~CommonFG();
00164 
00165 }; // end of CommonFG declaration
00166 
00167 #ifndef H5_NO_NAMESPACE
00168 }
00169 #endif
00170 #endif
00171 

Generated on Fri Oct 31 11:04:08 2008 by  doxygen 1.3.9.1