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

Generated on Sun Apr 10 16:43:54 2005 by  doxygen 1.3.9.1