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

Generated on Mon Oct 31 04:59:47 2005 by  doxygen 1.4.2