HDF5 C++ API Reference Manual

 

 

 

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

H5Attribute.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 #ifndef _H5Attribute_H
00017 #define _H5Attribute_H
00018 
00019 #ifndef H5_NO_NAMESPACE
00020 namespace H5 {
00021 #endif
00022 
00023 class H5_DLLCPP Attribute : public AbstractDs {
00024    public:
00025         // Gets the name of this attribute.
00026         ssize_t getName( size_t buf_size, string& attr_name ) const;
00027         string getName( size_t buf_size ) const; // returns name, not its length
00028         string getName() const; // returns name, no argument
00029 
00030         // Gets a copy of the dataspace for this attribute.
00031         virtual DataSpace getSpace() const;
00032 
00033         // Returns the amount of storage size required for this attribute.
00034         virtual hsize_t getStorageSize() const;
00035 
00036         // Reads data from this attribute.
00037         void read( const DataType& mem_type, void *buf ) const;
00038         void read( const DataType& mem_type, string& strg ) const;
00039 
00040         // Writes data to this attribute.
00041         void write(const DataType& mem_type, const void *buf ) const;
00042         void write(const DataType& mem_type, const string& strg ) const;
00043 
00044         // Creates a copy of an existing attribute using the attribute id
00045         Attribute( const hid_t attr_id );
00046 
00047         // Copy constructor: makes a copy of an existing Attribute object.
00048         Attribute( const Attribute& original );
00049 
00050         // Default constructor
00051         Attribute();
00052 
00053         // Close this attribute.
00054         virtual void close();
00055 
00056         // Destructor: properly terminates access to this attribute.
00057         virtual ~Attribute();
00058 
00059    private:
00060         // This function contains the common code that is used by 
00061         // getTypeClass and various API functions getXxxType 
00062         // defined in AbstractDs for generic datatype and specific 
00063         // sub-types
00064         virtual hid_t p_get_type() const;
00065 
00066         // do not inherit 'iterateAttrs' from H5Object
00067         int iterateAttrs() { return 0; }
00068 
00069         // do not inherit 'rename' from H5Object
00070         void rename() {}
00071 };
00072 #ifndef H5_NO_NAMESPACE
00073 }
00074 #endif
00075 #endif

Generated on Sat Apr 23 16:19:44 2005 by  doxygen 1.4.2