HDF5 C++ API Reference Manual

 

 

 

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

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