HDF5 C++ API Reference Manual

 

 

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

Generated on 11 Apr 2013 by  doxygen 1.4.7