HDF5 C++ API Reference Manual

 

 

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         virtual hsize_t getStorageSize() const;
00042 
00043         // Returns the in memory size of this attribute's data.
00044         virtual size_t getInMemDataSize() const;
00045 
00046         // Reads data from this attribute.
00047         void read( const DataType& mem_type, void *buf ) const;
00048         void read( const DataType& mem_type, H5std_string& strg ) const;
00049 
00050         // Writes data to this attribute.
00051         void write(const DataType& mem_type, const void *buf ) const;
00052         void write(const DataType& mem_type, const H5std_string& strg ) const;
00053 
00054         // Flushes all buffers associated with the file specified by this
00055         // attribute to disk.
00056         void flush( H5F_scope_t scope ) const;
00057 
00059         virtual H5std_string fromClass () const { return("Attribute"); }
00060 
00061         // Creates a copy of an existing attribute using the attribute id
00062         Attribute( const hid_t attr_id );
00063 
00064         // Copy constructor: makes a copy of an existing Attribute object.
00065         Attribute( const Attribute& original );
00066 
00067         // Default constructor
00068         Attribute();
00069 
00070         // Gets the attribute id.
00071         virtual hid_t getId() const;
00072 
00073         // Destructor: properly terminates access to this attribute.
00074         virtual ~Attribute();
00075 
00076    protected:
00077         // Sets the attribute id.
00078         virtual void p_setId(const hid_t new_id);
00079 
00080    private:
00081         hid_t id;       // HDF5 attribute id
00082 
00083         // This function contains the common code that is used by
00084         // getTypeClass and various API functions getXxxType
00085         // defined in AbstractDs for generic datatype and specific
00086         // sub-types
00087         virtual hid_t p_get_type() const;
00088 
00089         // Reads variable or fixed len strings from this attribute.
00090         void p_read_variable_len(const DataType& mem_type, H5std_string& strg) const;
00091         void p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const;
00092 
00093         // do not inherit H5Object::iterateAttrs
00094         int iterateAttrs() { return 0; }
00095 
00096         // do not inherit H5Object::renameAttr
00097         void renameAttr() {}
00098 };
00099 #ifndef H5_NO_NAMESPACE
00100 }
00101 #endif
00102 #endif

Generated on 11 Apr 2013 by  doxygen 1.4.7