HDF5 C++ API Reference Manual

 

 

 

Main Page | Namespace List | Class Hierarchy | Class List | File List | Class 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 [email protected]. *
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 dimensionality of the specified member.
00040         int getMemberDims( unsigned member_num, size_t* dims, int* perm ) const; // obsolete
00041 
00042         // Returns the index of a member in this compound data type.
00043         int getMemberIndex(const char* name) const;
00044         int getMemberIndex(const string& name) const;
00045 
00046         // Returns the offset of a member of this compound datatype.
00047         size_t getMemberOffset( unsigned memb_no ) const;
00048 
00049         // Returns the name of a member of this compound datatype.
00050         string getMemberName( unsigned member_num ) const;
00051 
00052         // Returns the generic datatype of the specified member in
00053         // this compound datatype.
00054         DataType getMemberDataType( unsigned member_num ) const;
00055 
00056         // Returns the compound datatype of the specified member in
00057         // this compound datatype.
00058         ArrayType getMemberArrayType( unsigned member_num ) const;
00059 
00060         // Returns the compound datatype of the specified member in
00061         // this compound datatype.
00062         CompType getMemberCompType( unsigned member_num ) const;
00063 
00064         // Returns the enumeration datatype of the specified member in
00065         // this compound datatype.
00066         EnumType getMemberEnumType( unsigned member_num ) const;
00067 
00068         // Returns the integer datatype of the specified member in
00069         // this compound datatype.
00070         IntType getMemberIntType( unsigned member_num ) const;
00071 
00072         // Returns the floating-point datatype of the specified member in
00073         // this compound datatype.
00074         FloatType getMemberFloatType( unsigned member_num ) const;
00075 
00076         // Returns the string datatype of the specified member in
00077         // this compound datatype.
00078         StrType getMemberStrType( unsigned member_num ) const;
00079 
00080         // Returns the compound datatype of the specified member in
00081         // this compound datatype.
00082         VarLenType getMemberVarLenType( unsigned member_num ) const;
00083 
00084         // Returns the number of members in this compound datatype.
00085         int getNmembers() const;
00086 
00087         // Adds a new member to this compound datatype.
00088         void insertMember( const string& name, size_t offset, const DataType& new_member ) const;
00089 
00090         // Recursively removes padding from within this compound datatype.
00091         void pack() const;
00092 
00093         // Returns this class name
00094         virtual string fromClass () const { return("CompType"); }
00095 
00096         // Default constructor
00097         CompType();
00098 
00099         // Creates a compound datatype using an existing id
00100         CompType( const hid_t existing_id );
00101 
00102         // Copy constructor - makes a copy of original object
00103         CompType( const CompType& original );
00104 
00105         // Noop destructor.
00106         virtual ~CompType();
00107 
00108    private:
00109         // Contains common code that is used by the member functions
00110         // getMemberXxxType
00111         hid_t p_get_member_type(unsigned member_num) const;
00112 };
00113 #ifndef H5_NO_NAMESPACE
00114 }
00115 #endif
00116 #endif

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