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, public IdComponent {
00025    public:
00026         // Closes this attribute.
00027         virtual void close();
00028 
00029         // Gets the name of the file, in which this attribute belongs.
00030         H5std_string getFileName() const;
00031 
00032         // Gets the name of this attribute.
00033         ssize_t getName( size_t buf_size, H5std_string& attr_name ) const;
00034         H5std_string getName( size_t buf_size ) const; // returns name, not its length
00035         H5std_string getName() const; // returns name, no argument
00036 
00037         // Gets a copy of the dataspace for this attribute.
00038         virtual DataSpace getSpace() const;
00039 
00040         // Returns the amount of storage size required for this attribute.
00041         hsize_t getStorageSize() const;
00042 
00043         // Reads data from this attribute.
00044         void read( const DataType& mem_type, void *buf ) const;
00045         void read( const DataType& mem_type, H5std_string& strg ) const;
00046 
00047         // Writes data to this attribute.
00048         void write(const DataType& mem_type, const void *buf ) const;
00049         void write(const DataType& mem_type, const H5std_string& strg ) const;
00050 
00051         // Creates an attribute by way of dereference.
00052         Attribute(H5Object& obj, void* ref);
00053         Attribute(H5File& file, void* ref);
00054 
00055         // Returns this class name
00056         virtual H5std_string fromClass () const { return("Attribute"); }
00057 
00058         // Creates a copy of an existing attribute using the attribute id
00059         Attribute( const hid_t attr_id );
00060 
00061         // Copy constructor: makes a copy of an existing Attribute object.
00062         Attribute( const Attribute& original );
00063 
00064         // Default constructor
00065         Attribute();
00066 
00067         // Gets/Sets the attribute id.
00068         virtual hid_t getId() const;
00069         virtual void setId(const hid_t new_id);
00070 
00071         // Destructor: properly terminates access to this attribute.
00072         virtual ~Attribute();
00073 
00074    private:
00075         hid_t id;       // HDF5 attribute id
00076 
00077         // This function contains the common code that is used by
00078         // getTypeClass and various API functions getXxxType
00079         // defined in AbstractDs for generic datatype and specific
00080         // sub-types
00081         virtual hid_t p_get_type() const;
00082 
00083         // do not inherit H5Object::iterateAttrs
00084         int iterateAttrs() { return 0; }
00085 
00086         // do not inherit H5Object::renameAttr
00087         void renameAttr() {}
00088 };
00089 #ifndef H5_NO_NAMESPACE
00090 }
00091 #endif
00092 #endif

Generated on Fri May 23 18:50:11 2008 by  doxygen 1.3.9.1