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, size_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 the size of a datatype. 
00066         size_t getSize() const;
00067 
00068         // Returns the base datatype from which a datatype is derived. 
00069         // Note: not quite right for specific types yet???
00070         DataType getSuper() const;
00071 
00072         // Registers a conversion function. 
00073         void registerFunc(H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const;
00074         void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const;
00075 
00076         // Removes a conversion function from all conversion paths. 
00077         void unregister( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const;
00078         void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const;
00079 
00080         // Tags an opaque datatype. 
00081         void setTag( const string& tag ) const;
00082         void setTag( const char* tag ) const;
00083 
00084         // Gets the tag associated with an opaque datatype. 
00085         string getTag() const;
00086 
00087         // Checks whether this datatype contains (or is) a certain type class.
00088         bool detectClass(H5T_class_t cls) const;
00089 
00090         // Checks whether this datatype is a variable-length string.
00091         bool isVariableStr() const;
00092 
00093         // Creates a reference to a named Hdf5 object in this object.
00094         void* Reference(const char* name) const;
00095 
00096         // Creates a reference to a named Hdf5 object or to a dataset region
00097         // in this object.
00098         void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const;
00099 
00100         // Retrieves the type of object that an object reference points to.
00101         H5G_obj_t getObjType(void *ref, H5R_type_t ref_type) const;
00102 
00103         // Retrieves a dataspace with the region pointed to selected.
00104         DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) 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         // Destructor: properly terminates access to this datatype.
00113         virtual ~DataType();
00114 
00115    protected:
00116         bool is_predtype;       // indicates a type is predefined so
00117                                 // H5Tclose will not be called for it
00118 };
00119 #ifndef H5_NO_NAMESPACE
00120 }
00121 #endif
00122 #endif

Generated on Sat Apr 23 16:19:45 2005 by  doxygen 1.4.2