BioHDF version 0.3 alpha
Scalable NGS Data Storage Based on HDF5
biohdf_attribute.h
00001 /*****************************************************************************
00002  * Copyright by The HDF Group                                                *
00003  * All rights reserved.                                                      *
00004  *                                                                           *
00005  * This file is part of BioHDF.  The full BioHDF copyright notice, including *
00006  * terms governing use, modification, and redistribution, is contained in    *
00007  * the file COPYING.  COPYING can be found at the root of the source code    *
00008  * distribution tree.  If you do not have access to this file, you may       *
00009  * request a copy from help@hdfgroup.org.                                    *
00010  *****************************************************************************/
00011 
00012 #ifndef _BIOHDF_ATTRIBUTE_H
00013 #define _BIOHDF_ATTRIBUTE_H
00014 
00015 #include "biohdf_api.h"
00016 #include "biohdf_error.h"
00017 #include "biohdf_file.h"
00018 
00019 
00020 /* NOT IMPLEMENTED YET - This file is a placeholder */
00021 
00022 
00023 /* Allowed BioHDF attribute types */
00024 typedef enum _biohdf_attribute_type
00025 {
00026     INTEGER_ATTRIBUTE_TYPE,    /* 64 bit signed */
00027     DOUBLE_ATTRIBUTE_TYPE,
00028     STRING_ATTRIBUTE_TYPE,
00029 } biohdf_attribute_type;
00030 
00031 
00032 /* Data structure for a BioHDF attributes */
00033 typedef struct _biohdf_attribute_data
00034 {
00035     char                   *name;
00036     biohdf_attribute_type  atype;
00037     union
00038     {
00039         int64_t i;
00040         double       d;
00041         char         *str;
00042     } data;
00043 } biohdf_attribute_data;
00044 
00045 
00046 /* Creates a BioHDF attribute in the target group. */
00047 BIOHDF_API biohdf_error
00048 BIOHDFcreate_attribute(biohdf_file f,
00049                        const char *path,
00050                        const char *name,
00051                        biohdf_attribute_data attribute);
00052 
00053 
00054 
00055 /* Deletes a BioHDF attribute in the target group. */
00056 BIOHDF_API biohdf_error
00057 BIOHDFdelete_attribute(biohdf_file f,
00058                        const char *path,
00059                        const char *attribute_name);
00060 
00061 
00062 
00063 /* Gets a BioHDF attribute in the target group. */
00064 BIOHDF_API biohdf_error
00065 BIOHDFget_attribute(biohdf_file f,
00066                     const char *path,
00067                     /*OUT*/ biohdf_attribute_data **attribute);
00068 
00069 
00070 /* Get a list of all the BioHDF attributes attached to a group */
00071 BIOHDF_API biohdf_error
00072 BIOHDFget_list_of_attributes(biohdf_file f,
00073                              const char *path,
00074                              /*OUT*/ int *n_attributes,
00075                              /*OUT*/ biohdf_attribute_data **attributes);
00076 
00077 
00078 /* Free a BioHDF attribute obtained from the API */
00079 BIOHDF_API biohdf_error
00080 BIOHDFfree_attribute(/*OUT*/ biohdf_attribute_data **attribute);
00081 
00082 
00083 
00084 /* Free a list of BioHDF attributes obtained from the API */
00085 BIOHDF_API biohdf_error
00086 BIOHDFfree_list_of_attributes(int n_attributes,
00087                               /*OUT*/ biohdf_attribute_data **attributes);
00088 
00089 #endif
 All Data Structures Variables