HDF5 C++ API Reference Manual

 

 

 

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

Generated on Tue Aug 14 13:56:59 2007 by  doxygen 1.3.9.1