HDF5 C++ API Reference Manual

 

 

 

Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File 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 HDF Group.                                               *
00004  * Copyright by the Board of Trustees of the University of Illinois.         *
00005  * All rights reserved.                                                      *
00006  *                                                                           *
00007  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00008  * terms governing use, modification, and redistribution, is contained in    *
00009  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00010  * of the source code distribution tree; Copyright.html can be found at the  *
00011  * root level of an installed copy of the electronic HDF5 document set and   *
00012  * is linked from the top-level documents page.  It can also be found at     *
00013  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00014  * access to either file, you may request a copy from help@hdfgroup.org.     *
00015  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00016 
00017 #ifndef _H5DataType_H
00018 #define _H5DataType_H
00019 
00020 #ifndef H5_NO_NAMESPACE
00021 namespace H5 {
00022 #endif
00023 
00024 class H5_DLLCPP DataType : public H5Object {
00025    public:
00026         // Creates a datatype given its class and size
00027         DataType( const H5T_class_t type_class, size_t size );
00028 
00029         // Copy constructor: makes a copy of the original object
00030         DataType( const DataType& original );
00031 
00032         // Creates a datatype by way of dereference.
00033         DataType(IdComponent& obj, void* ref);
00034 
00035         // Closes this datatype.
00036         virtual void close();
00037 
00038         // Copies an existing datatype to this datatype object.
00039         void copy(const DataType& like_type);
00040 
00041         // Copies the datatype of dset to this datatype object.
00042         void copy(const DataSet& dset);
00043 
00044         // Returns the datatype class identifier.
00045         H5T_class_t getClass() const;
00046 
00047         // Commits a transient datatype to a file; this datatype becomes
00048         // a named datatype which can be accessed from the location.
00049         void commit( H5File& loc, const char* name);
00050         void commit( H5File& loc, const H5std_string& name);
00051         void commit( H5Object& loc, const char* name);
00052         void commit( H5Object& loc, const H5std_string& name);
00053 
00054         // Determines whether this datatype is a named datatype or
00055         // a transient datatype.
00056         bool committed() const;
00057 
00058         // Finds a conversion function that can handle the conversion
00059         // this datatype to the given datatype, dest.
00060         H5T_conv_t find( const DataType& dest, H5T_cdata_t **pcdata ) const;
00061 
00062         // Converts data from between specified datatypes.
00063         void convert( const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist=PropList::DEFAULT) const;
00064 
00065         // Assignment operator
00066         DataType& operator=( const DataType& rhs );
00067 
00068         // Determines whether two datatypes are the same.
00069         bool operator==(const DataType& compared_type ) const;
00070 
00071         // Locks a datatype.
00072         void lock() const;
00073 
00074         // Returns a pointer to the current global overflow function.
00075         H5T_overflow_t getOverflow(void) const;
00076 
00077         // Sets the overflow handler to a specified function.
00078         void setOverflow(H5T_overflow_t func) const;
00079 
00080         // Returns the size of a datatype.
00081         size_t getSize() const;
00082 
00083         // Returns the base datatype from which a datatype is derived.
00084         // Note: not quite right for specific types yet???
00085         DataType getSuper() const;
00086 
00087         // Registers a conversion function.
00088         void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const;
00089         void registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const;
00090 
00091         // Removes a conversion function from all conversion paths.
00092         void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const;
00093         void unregister( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const;
00094 
00095         // Tags an opaque datatype.
00096         void setTag( const char* tag ) const;
00097         void setTag( const H5std_string& tag ) const;
00098 
00099         // Gets the tag associated with an opaque datatype.
00100         H5std_string getTag() const;
00101 
00102         // Checks whether this datatype contains (or is) a certain type class.
00103         bool detectClass(H5T_class_t cls) const;
00104 
00105         // Checks whether this datatype is a variable-length string.
00106         bool isVariableStr() const;
00107 
00108         // Creates a reference to a named HDF5 object or to a dataset region
00109         // in this object.
00110         void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const; // will be obsolete
00111 
00112         // Creates a reference to a named HDF5 object in this object.
00113         void* Reference(const char* name) const; // will be obsolete
00114         void* Reference(const H5std_string& name) const; // will be obsolete
00115 
00116         // Retrieves the type of object that an object reference points to.
00117         H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
00118 
00119         // Retrieves a dataspace with the region pointed to selected.
00120         DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
00121 
00122         // Returns this class name
00123         virtual H5std_string fromClass () const { return("DataType"); }
00124 
00125         // Creates a copy of an existing DataType using its id
00126         DataType( const hid_t type_id );
00127 
00128         // Default constructor
00129         DataType();
00130 
00131         // Destructor: properly terminates access to this datatype.
00132         virtual ~DataType();
00133    private:
00134         void p_commit(hid_t loc_id, const char* name);
00135 };
00136 #ifndef H5_NO_NAMESPACE
00137 }
00138 #endif
00139 #endif

Generated on Tue Aug 14 13:56:59 2007 by  doxygen 1.3.9.1