HDF5 C++ API Reference Manual

 

 

 

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

H5DataType.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 #ifndef _H5DataType_H 00017 #define _H5DataType_H 00018 00019 #ifndef H5_NO_NAMESPACE 00020 namespace H5 { 00021 #endif 00022 00023 class H5_DLLCPP DataType : public H5Object { 00024 public: 00025 // Creates a datatype given its class and size 00026 DataType( const H5T_class_t type_class, size_t size ); 00027 00028 // Copies an existing datatype to this datatype object 00029 void copy( const DataType& like_type ); 00030 00031 // Commits a transient datatype to a file; this datatype becomes 00032 // a named datatype which can be accessed from the location. 00033 void commit( CommonFG& loc, const char* name ) const; 00034 void commit( CommonFG& loc, const string& name ) const; 00035 00036 // Determines whether this datatype is a named datatype or 00037 // a transient datatype. 00038 bool committed() const; 00039 00040 // Converts data from between specified datatypes. 00041 void convert( const DataType& dest, hsize_t nelmts, void *buf, void *background, PropList& plist ) const; 00042 00043 // Checks whether this datatype contains (or is) a certain type class. 00044 bool detectClass(H5T_class_t cls) const; 00045 00046 // Finds a conversion function that can handle the conversion 00047 // this datatype to the given datatype, dest. 00048 H5T_conv_t find( const DataType& dest, H5T_cdata_t **pcdata ) const; 00049 00050 // Returns the datatype class identifier. 00051 H5T_class_t getClass() const; 00052 00053 // Returns a pointer to the current global overflow function. 00054 H5T_overflow_t getOverflow(void) const; 00055 00056 // Sets the overflow handler to a specified function. 00057 void setOverflow(H5T_overflow_t func) const; 00058 00059 // Returns the size of a datatype. 00060 size_t getSize() const; 00061 00062 // Returns the base datatype from which a datatype is derived. 00063 // Note: not quite right for specific types yet??? 00064 DataType getSuper() const; 00065 00066 // Gets the tag associated with an opaque datatype. 00067 string getTag() const; 00068 00069 // Tags an opaque datatype. 00070 void setTag( const string& tag ) const; 00071 void setTag( const char* tag ) const; 00072 00073 // Checks whether this datatype is a variable-length string. 00074 bool isVariableStr() const; 00075 00076 // Locks a datatype. 00077 void lock() const; 00078 00079 // Assignment operator 00080 DataType& operator=( const DataType& rhs ); 00081 00082 // Determines whether two datatypes are the same. 00083 bool operator==(const DataType& compared_type ) const; 00084 00085 // Registers a conversion function. 00086 void registerFunc(H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const; 00087 void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; 00088 00089 // Removes a conversion function from all conversion paths. 00090 void unregister( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const; 00091 void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; 00092 00093 // Retrieves the type of object that an object reference points to. 00094 H5G_obj_t getObjType(void *ref, H5R_type_t ref_type) const; 00095 00096 // Retrieves a dataspace with the region pointed to selected. 00097 DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; 00098 00099 // Creates a reference to a named Hdf5 object or to a dataset region 00100 // in this object. 00101 void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const; 00102 00103 // Creates a reference to a named Hdf5 object in this object. 00104 void* Reference(const char* name) const; 00105 00106 // Creates a copy of an existing DataType using its id 00107 DataType( const hid_t type_id, bool predtype = false ); 00108 00109 // Default constructor 00110 DataType(); 00111 00112 // Copy constructor: makes a copy of the original object 00113 DataType( const DataType& original ); 00114 00115 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00116 // Used by the API to appropriately close a datatype 00117 void p_close() const; 00118 #endif // DOXYGEN_SHOULD_SKIP_THIS 00119 00120 // Destructor: properly terminates access to this datatype. 00121 virtual ~DataType(); 00122 00123 protected: 00124 bool is_predtype; // indicates a type is predefined so 00125 // H5Tclose will not be called for it 00126 }; 00127 #ifndef H5_NO_NAMESPACE 00128 } 00129 #endif 00130 #endif

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