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 00073 // Returns the type of an object in this group, given the 00074 // object's index. 00075 H5G_obj_t getObjTypeByIdx(hsize_t idx) const; 00076 H5G_obj_t getObjTypeByIdx(hsize_t idx, string& type_name) const; 00077 00078 // Iterates over the elements of this group - not implemented in 00079 // C++ style yet. 00080 int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data); 00081 int iterateElems(const string& name, int *idx, H5G_iterate_t op, void *op_data); 00082 00083 // Creates a link of the specified type from new_name to current_name; 00084 // both names are interpreted relative to the specified location id. 00085 void link(H5G_link_t link_type, const char* curr_name, const char* new_name) const; 00086 void link(H5G_link_t link_type, const string& curr_name, const string& new_name) const; 00087 00088 // Removes the specified name at this location. 00089 void unlink(const char* name) const; 00090 void unlink(const string& name) const; 00091 00092 // Mounts the file 'child' onto this location. 00093 void mount(const char* name, H5File& child, PropList& plist) const; 00094 void mount(const string& name, H5File& child, PropList& plist) const; 00095 00096 // Unmounts the file named 'name' from this parent location. 00097 void unmount(const char* name) const; 00098 void unmount(const string& name) const; 00099 00100 // Renames an object at this location. 00101 void move(const char* src, const char* dst) const; 00102 void move(const string& src, const string& dst) const; 00103 00104 // Opens a generic named datatype in this location. 00105 DataType openDataType(const char* name) const; 00106 DataType openDataType(const string& name) const; 00107 00108 // Opens a named enumeration datatype in this location. 00109 EnumType openEnumType(const char* name) const; 00110 EnumType openEnumType(const string& name) const; 00111 00112 // Opens a named compound datatype in this location. 00113 CompType openCompType(const char* name) const; 00114 CompType openCompType(const string& name) const; 00115 00116 // Opens a named integer datatype in this location. 00117 IntType openIntType(const char* name) const; 00118 IntType openIntType(const string& name) const; 00119 00120 // Opens a named floating-point datatype in this location. 00121 FloatType openFloatType(const char* name) const; 00122 FloatType openFloatType(const string& name) const; 00123 00124 // Opens a named string datatype in this location. 00125 StrType openStrType(const char* name) const; 00126 StrType openStrType(const string& name) const; 00127 00130 virtual hid_t getLocId() const = 0; 00131 00133 virtual void throwException(const string func_name, const string msg) const = 0; 00134 00135 // Default constructor. 00136 CommonFG(); 00137 00138 // Noop destructor. 00139 virtual ~CommonFG(); 00140 00141 private: 00142 // Common code for member functions openXxxType 00143 hid_t p_open_data_type(const char* name) const; 00144 00145 }; // end of CommonFG declaration 00146 00147 #ifndef H5_NO_NAMESPACE 00148 } 00149 #endif 00150 #endif 00151

Generated on Thu Aug 5 00:22:37 2004 by doxygen 1.3.7-20040718