HDF5 C++ API Reference Manual

 

 

 

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

H5Object.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 _H5Object_H
00018 #define _H5Object_H
00019 
00020 #include "H5Classes.h"          // constains forward class declarations
00021 
00022 // H5Object is a baseclass.  It has these subclasses:
00023 // Group, AbstractDs, and DataType.
00024 // AbstractDs, in turn, has subclasses DataSet and Attribute.
00025 // DataType, in turn, has several specific datatypes as subclasses.
00026 
00027 #ifndef H5_NO_NAMESPACE
00028 namespace H5 {
00029 #endif
00030 
00031 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00032 class H5_DLLCPP H5Object;  // forward declaration for UserData4Aiterate
00033 
00034 // Define the operator function pointer for H5Aiterate().
00035 typedef void (*attr_operator_t)( H5Object& loc/*in*/,
00036                                  const H5std_string attr_name/*in*/,
00037                                  void *operator_data/*in,out*/);
00038 
00039 class UserData4Aiterate { // user data for attribute iteration
00040    public:
00041         unsigned int* idx;
00042         attr_operator_t op;
00043         void* opData;
00044         H5Object* object;
00045 };
00046 #endif // DOXYGEN_SHOULD_SKIP_THIS
00047 
00048 // The above part is being moved into Iterator, but not completed
00049 
00050 class H5_DLLCPP H5Object : public IdComponent {
00051    public:
00052         // Creates an attribute for a group, dataset, or named datatype.
00053         // PropList is currently not used, so always be default.
00054         Attribute createAttribute( const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const;
00055         Attribute createAttribute( const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const;
00056 
00057         // Opens an attribute given its name.
00058         Attribute openAttribute( const char* name ) const;
00059         Attribute openAttribute( const H5std_string& name ) const;
00060 
00061         // Opens an attribute given its index.
00062         Attribute openAttribute( const unsigned int idx ) const;
00063 
00064         // Flushes all buffers associated with this object to disk
00065         void flush( H5F_scope_t scope ) const;
00066 
00067         // Gets the name of the file, in which this HDF5 object belongs.
00068         H5std_string getFileName() const;
00069 
00070         // Determines the number of attributes attached to this object.
00071         int getNumAttrs() const;
00072 
00073         // Iterate user's function over the attributes of this object
00074         int iterateAttrs( attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL );
00075 
00076         // Removes the named attribute from this object.
00077         void removeAttr( const char* name ) const;
00078         void removeAttr( const H5std_string& name ) const;
00079 
00080         // Renames the attribute to a new name.
00081         void renameAttr(const char* oldname, const char* newname) const;
00082         void renameAttr(const H5std_string& oldname, const H5std_string& newname) const;
00083 
00084         // Copy constructor: makes copy of an H5Object object.
00085         H5Object(const H5Object& original);
00086 
00087         // Noop destructor.
00088         virtual ~H5Object();
00089 
00090    protected:
00091 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00092         // Default constructor
00093         H5Object();
00094 
00095         // Creates a copy of an existing object giving the object id
00096         H5Object( const hid_t object_id );
00097 #endif // DOXYGEN_SHOULD_SKIP_THIS
00098 
00099 }; /* end class H5Object */
00100 
00101 #ifndef H5_NO_NAMESPACE
00102 }
00103 #endif
00104 #endif

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