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 [email protected]. *
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         // Returns this class name
00045         virtual string fromClass () const { return("Attribute"); }
00046 
00047         // Creates a copy of an existing attribute using the attribute id
00048         Attribute( const hid_t attr_id );
00049 
00050         // Copy constructor: makes a copy of an existing Attribute object.
00051         Attribute( const Attribute& original );
00052 
00053         // Default constructor
00054         Attribute();
00055 
00056         // Close this attribute.
00057         virtual void close();
00058 
00059         // Destructor: properly terminates access to this attribute.
00060         virtual ~Attribute();
00061 
00062    private:
00063         // This function contains the common code that is used by
00064         // getTypeClass and various API functions getXxxType
00065         // defined in AbstractDs for generic datatype and specific
00066         // sub-types
00067         virtual hid_t p_get_type() const;
00068 
00069         // do not inherit 'iterateAttrs' from H5Object
00070         int iterateAttrs() { return 0; }
00071 
00072         // do not inherit 'rename' from H5Object
00073         void rename() {}
00074 };
00075 #ifndef H5_NO_NAMESPACE
00076 }
00077 #endif
00078 #endif

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