00001 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 hdfhelp@ncsa.uiuc.edu. * 00014 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 00015 00016 #include "clH5Handler.h" 00017 #include "h5Object.h" 00018 #include "h5File.h" 00019 #include "h5Group.h" 00020 #include "h5Dataset.h" 00021 #include <assert.h> 00022 00023 /*------------------------------------------------------------------------------ 00024 * Purpose: send client request to the server and process the response from server 00025 * Parameters: -- void *obj, The object to request 00026 * int objID, The ID to identify the type of the object 00027 * Return: Returns a non-negative value if successful; otherwise returns a negative value. 00028 *------------------------------------------------------------------------------ 00029 */ 00030 int h5ObjRequest(rcComm_t *conn, void *obj, int objID) 00031 { 00032 int ret_value=0; 00033 H5File *f = 0; 00034 H5Dataset *d=0; 00035 H5Group *g=0; 00036 00037 assert( obj ); 00038 00039 if (H5OBJECT_FILE == objID) 00040 { 00041 00042 f = (H5File *)obj; 00043 if (H5FILE_OP_OPEN == f->opID) 00044 ret_value = clH5File_open(conn, f); 00045 else if (H5FILE_OP_CLOSE == f->opID) 00046 ret_value = clH5File_close(conn, f); 00047 /* TODO at h5Handler -- more actions needs to be added here */ 00048 } 00049 else if (H5OBJECT_DATASET == objID) 00050 { 00051 d = (H5Dataset *)obj; 00052 if (H5DATASET_OP_READ == d->opID) 00053 ret_value = clH5Dataset_read (conn, d); 00054 else if (H5DATASET_OP_READ_ATTRIBUTE == d->opID) 00055 ret_value = clH5Dataset_read_attribute(conn, d); 00056 00057 /* TODO at h5Handler -- more actions needs to be added here */ 00058 } 00059 else if (H5OBJECT_GROUP == objID) 00060 { 00061 g = (H5Group *)obj; 00062 if (H5GROUP_OP_READ_ATTRIBUTE == g->opID) 00063 ret_value = clH5Group_read_attribute(conn, g); 00064 } 00065 00066 return ret_value; 00067 }