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 [email protected]. *
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 char* name ) const;
00043         void commit( CommonFG& loc, const string& 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 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 char* name, const DataType& dest, H5T_conv_t func ) const;
00080         void registerFunc(H5T_pers_t pers, const string& 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 char* name, const DataType& dest, H5T_conv_t func ) const;
00084         void unregister( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const;
00085 
00086         // Tags an opaque datatype.
00087         void setTag( const char* tag ) const;
00088         void setTag( const string& 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         void* Reference(const string& name) const;
00102 
00103         // Creates a reference to a named Hdf5 object or to a dataset region
00104         // in this object.
00105         void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const;
00106 
00107         // Retrieves the type of object that an object reference points to.
00108         H5G_obj_t getObjType(void *ref, H5R_type_t ref_type) const;
00109 
00110         // Retrieves a dataspace with the region pointed to selected.
00111         DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
00112 
00113         // Returns this class name
00114         virtual string fromClass () const { return("DataType"); }
00115 
00116         // Creates a copy of an existing DataType using its id
00117         DataType( const hid_t type_id, bool predtype = false );
00118 
00119         // Default constructor
00120         DataType();
00121 
00122         // Destructor: properly terminates access to this datatype.
00123         virtual ~DataType();
00124 
00125    protected:
00126         bool is_predtype;       // indicates a type is predefined so
00127                                 // H5Tclose will not be called for it
00128 };
00129 #ifndef H5_NO_NAMESPACE
00130 }
00131 #endif
00132 #endif

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