HDF5 C++ API Reference Manual

 

 

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

H5CompType.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 // Class CompType inherits from DataType and provides accesses to a compound
00017 // datatype.
00018 
00019 #ifndef _H5CompType_H
00020 #define _H5CompType_H
00021 
00022 #ifndef H5_NO_NAMESPACE
00023 namespace H5 {
00024 #endif
00025 
00026 class H5_DLLCPP CompType : public DataType {
00027    public:
00028         // Creates a new compound datatype, given the type's size
00029         CompType( size_t size ); // H5Tcreate
00030 
00031         // Gets the compound datatype of the specified dataset
00032         CompType( const DataSet& dataset );  // H5Dget_type
00033 
00034         // Returns the type class of the specified member of this compound
00035         // datatype.  It provides to the user a way of knowing what type
00036         // to create another datatype of the same class
00037         H5T_class_t getMemberClass( unsigned member_num ) const;
00038 
00039         // Returns the index of a member in this compound data type.
00040         int getMemberIndex(const char* name) const;
00041         int getMemberIndex(const H5std_string& name) const;
00042 
00043         // Returns the offset of a member of this compound datatype.
00044         size_t getMemberOffset( unsigned memb_no ) const;
00045 
00046         // Returns the name of a member of this compound datatype.
00047         H5std_string getMemberName( unsigned member_num ) const;
00048 
00049         // Returns the generic datatype of the specified member in
00050         // this compound datatype.
00051         DataType getMemberDataType( unsigned member_num ) const;
00052 
00053         // Returns the array datatype of the specified member in
00054         // this compound datatype.
00055         ArrayType getMemberArrayType( unsigned member_num ) const;
00056 
00057         // Returns the compound datatype of the specified member in
00058         // this compound datatype.
00059         CompType getMemberCompType( unsigned member_num ) const;
00060 
00061         // Returns the enumeration datatype of the specified member in
00062         // this compound datatype.
00063         EnumType getMemberEnumType( unsigned member_num ) const;
00064 
00065         // Returns the integer datatype of the specified member in
00066         // this compound datatype.
00067         IntType getMemberIntType( unsigned member_num ) const;
00068 
00069         // Returns the floating-point datatype of the specified member in
00070         // this compound datatype.
00071         FloatType getMemberFloatType( unsigned member_num ) const;
00072 
00073         // Returns the string datatype of the specified member in
00074         // this compound datatype.
00075         StrType getMemberStrType( unsigned member_num ) const;
00076 
00077         // Returns the variable length datatype of the specified member in
00078         // this compound datatype.
00079         VarLenType getMemberVarLenType( unsigned member_num ) const;
00080 
00081         // Returns the number of members in this compound datatype.
00082         int getNmembers() const;
00083 
00084         // Adds a new member to this compound datatype.
00085         void insertMember( const H5std_string& name, size_t offset, const DataType& new_member ) const;
00086 
00087         // Recursively removes padding from within this compound datatype.
00088         void pack() const;
00089 
00090         // Returns this class name
00091         virtual H5std_string fromClass () const { return("CompType"); }
00092 
00093         // Default constructor
00094         CompType();
00095 
00096         // Creates a compound datatype using an existing id
00097         CompType( const hid_t existing_id );
00098 
00099         // Copy constructor - makes a copy of original object
00100         CompType( const CompType& original );
00101 
00102         // Noop destructor.
00103         virtual ~CompType();
00104 
00105    private:
00106         // Contains common code that is used by the member functions
00107         // getMemberXxxType
00108         hid_t p_get_member_type(unsigned member_num) const;
00109 };
00110 #ifndef H5_NO_NAMESPACE
00111 }
00112 #endif
00113 #endif

Generated on Thu Apr 20 15:16:40 2006 by doxygen 1.3.2